diff --git a/R/confirmatoryfactoranalysis.R b/R/confirmatoryfactoranalysis.R index 25b0866..8161c2c 100644 --- a/R/confirmatoryfactoranalysis.R +++ b/R/confirmatoryfactoranalysis.R @@ -191,8 +191,11 @@ confirmatoryFactorAnalysisInternal <- function(jaspResults, dataset, options, .. if (options$group == "") grp <- NULL else grp <- options$group if (anyNA(dataset)) { - naAction <- ifelse(options$naAction == "twoStageRobust", "robust.two.stage", - ifelse(options$naAction == "twoStage", "two.stage", options$naAction)) + naAction <- switch( + options$naAction, + "twoStageRobust" = "robust.two.stage", + "twoStage" = "two.stage", + options$naAction) } else { naAction <- "listwise" }