MplusAutomation icon indicating copy to clipboard operation
MplusAutomation copied to clipboard

Error in if (all(sapply(modelList, function(x) { : missing value where TRUE/FALSE needed In addition: Warning message: In all(sapply(modelList, function(x) { : coercing argument of type 'list' to logical

Open joshua-zh opened this issue 2 years ago • 0 comments

Hi, would you like to help me?

library(poLCA) data(cheating)

cheating <- cheating %>% clean_names()

df_cheat <- cheating %>% # dplyr::select(1:4) %>% # dplyr::mutate_all(funs(.-1)) #

Run a quick LCA using createMixtures

createMixtures(classes = 1:4, filename_stem = "cheat",
rdata = df_cheat,
ANALYSIS = "processors = 10; starts 500 100;",
VARIABLE = "CATEGORICAL = lieexam-copyexam;",
PLOT = "type = plot3; series = lieexam-copyexam(*);")

files <- data.frame(names = list.files(path = here(), full.names = FALSE))

f_cheat <- files %>% dplyr::filter(., grepl('cheat', names))

for (i in 1:length(f_cheat)) { file.move(glue(here("{f_cheat[, i]}")), here("enum_ch")) }

runModels(here("enum_ch"), filefilter = "cheat")

View model fit statistics with mixtureSummaryTable()

output_cheat <- readModels(here("enum_ch"), filefilter = "cheat", quiet = TRUE)

No PROPORTION OF DATA PRESENT sections found within COVARIANCE COVERAGE OF DATA output. No PROPORTION OF DATA PRESENT sections found within COVARIANCE COVERAGE OF DATA output. No PROPORTION OF DATA PRESENT sections found within COVARIANCE COVERAGE OF DATA output. No PROPORTION OF DATA PRESENT sections found within COVARIANCE COVERAGE OF DATA output.

gt(mixtureSummaryTable(output_cheat)) %>% # tab_header( # title = "Fit Indices") %>% # tab_options( # table.width = pct(80)) %>% # tab_footnote( # footnote = "Undergraduate Cheating Behavior", # location = cells_title())

Error in if (all(sapply(modelList, function(x) { : missing value where TRUE/FALSE needed In addition: Warning message: In all(sapply(modelList, function(x) { : coercing argument of type 'list' to logical

joshua-zh avatar Aug 12 '22 05:08 joshua-zh