getting data to xlsx error (tidyLPA)

mfinal <- data %>%
select(intrinsic, career, determination, efficacy, grade) %>%
single_imputation() %>%
scale() %>%
estimate_profiles(3, variances = "varying", covariances = "varying" )

write.csv(mfinal, "mfinal.csv")

using tidyLPA, i got the data and want to get excel file.
but there's error like this;
Error in[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :
cannot coerce class ‘"Mclust"’ to a data.frame
how can I get the excel data?

Not familiar with that library, but it seems mfinal is a complex object that has many information that can't be saved as a table; with get_data() you're extracting the table-formatted information. So, the only problem is that you need to save the results of get_data(mfinal), and not directly mfinal. You can do that with an intermediary variable:

mfinal_as_table <- get_data(mfinal)
write.csv(mfinal_as_table, "mfinal.csv")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.