Code: Select all
Error in nrow(likert5_data) : object 'likert5_data' not found
Error: unable to load R code in package 'FuzzyDelphiJmv'
Execution halted
ERROR: lazy loading failed for package 'FuzzyDelphiJmv'
* removing 'C:/Users/LerLerChan/Documents/FuzzyDelphiJmv/build/R4.1.2-win64/FuzzyDelphiJmv'
* restoring previous 'C:/Users/LerLerChan/Documents/FuzzyDelphiJmv/build/R4.1.2-win64/FuzzyDelphiJmv'
Code: Select all
# This file is a generated template, your changes will not be overwritten
FDMClass <- if (requireNamespace('jmvcore', quietly=TRUE)) R6::R6Class(
"FDMClass",
inherit = FDMBase,
private = list(
.run = function() {
likert5_data <- data.frame(
r = 1:5,
m1 = c(0, 0, 0.25, 0.5, 0.75),
m2 = c(0, 0.25, 0.5, 0.75, 1),
m3 = c(0.25, 0.5, 0.75, 1, 1)
)
likert5_to_m <- function(response) {
index <- match(response, likert5_data$r)
if(!is.na(index)) {
return(likert5_data[index, c("m1", "m2", "m3")])
} else {
return(NA)
}
}
mValues <- likert5_to_m(self$data[[self$options$dep]])
self$results$text$setContent(mValues)
})
)