Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #176

Open
joshua-zh opened this issue Aug 12, 2022 · 0 comments

Comments

@joshua-zh
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant