Running 'testthat.R' [27s/29s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(tidyLPA)
  tidyLPA has received a major update, with a much easier workflow and improved functionality. However, you might have to update old syntax to account for the new workflow. See vignette('introduction-to-major-changes') for details!
  
  Mplus is not installed. Use only package = 'mclust' when calling estimate_profiles().
  Warning message:
  In system2("type", args = "mplus", stdout = FALSE, stderr = FALSE) :
    error in running command
  > 
  > test_check("tidyLPA")
  -- 1. Error: (unknown) (@test-compare-solutions.R#10)  -------------------------
  object must be of class 'Mclust' or 'densityMclust'
  1: pisaUSA15[1:100, ] %>% single_imputation() %>% estimate_profiles(1:3, variances = c("equal", 
         "varying"), covariances = c("zero", "varying")) %>% compare_solutions(statistics = c("AIC", 
         "BIC")) at testthat/test-compare-solutions.R:10
  2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3: eval(quote(`_fseq`(`_lhs`)), env, env)
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: `_fseq`(`_lhs`)
  6: freduce(value, `_function_list`)
  7: function_list[[i]](value)
  8: estimate_profiles(., 1:3, variances = c("equal", "varying"), covariances = c("zero", 
         "varying"))
  9: estimate_profiles.data.frame(., 1:3, variances = c("equal", "varying"), covariances = c("zero", 
         "varying"))
  10: NextMethod("estimate_profiles", df)
  11: estimate_profiles.default(., 1:3, variances = c("equal", "varying"), covariances = c("zero", 
         "varying"))
  12: estimate_profiles_mclust(df, n_profiles, model_numbers, ...)
  13: mapply(FUN = function(this_class, this_model) {
         out <- list(model = Mclust(full_data, G = this_class, modelNames = ifelse(ncol(full_data) == 
             1, substr(get_modelname(this_model), 1, 1), get_modelname(this_model)), warn = FALSE, 
             verbose = FALSE, ...))
         out$model$mclustBootstrap <- MclustBootstrap(out$model, nboot = 100, type = "bs", 
             verbose = FALSE)
         out$model$LRTS <- ifelse(this_class == 1, NA, boot_blrt[[which(model_numbers == 
             this_model)]]$obs[this_class - 1])
         out$model$LRTS_p <- ifelse(this_class == 1, NA, boot_blrt[[which(model_numbers == 
             this_model)]]$p.value[this_class - 1])
         out$fit <- c(Model = this_model, Classes = this_class, calc_fitindices(out$model))
         estimates <- estimates(out$model)
         estimates$Model <- this_model
         estimates$Classes <- this_class
         if (this_class == 1) {
             estimates$se[estimates$Category == "Means"] <- estimates$Estimate[estimates$Category == 
                 "Variances"]/out$model$n
             estimates$se[estimates$Category == "Variances"] <- sapply(sqrt(estimates$Estimate[estimates$Category == 
                 "Variances"]), se_s, n = out$model$n)^2
             estimates$p <- stats::pnorm(abs(estimates$Estimate), sd = estimates$se, lower.tail = FALSE)
         }
         out$estimates <- estimates
         outdat <- cbind(out$model$z, out$model$classification)
         dff <- matrix(NA, dim(df)[1], dim(outdat)[2])
         dff[no_na_rows, ] <- outdat
         colnames(dff) <- c(paste0("CPROB", 1:ncol(out$model$z)), "Class")
         out$dff <- as_tibble(cbind(df, dff))
         out$dff$model_number <- this_model
         out$dff$classes_number <- this_class
         out$dff <- out$dff[, c((ncol(out$dff) - 1), ncol(out$dff), 1:(ncol(out$dff) - 
             2))]
         warnings <- NULL
         if (out$fit[["prob_min"]] < 0.001) 
             warnings <- c(warnings, "Some classes were not assigned any cases with more than .1% probability. Consequently, these solutions are effectively identical to a solution with one class less.")
         if (out$fit[["n_min"]] < 0.01) 
             warnings <- c(warnings, "Less than 1% of cases were assigned to one of the profiles. Interpret this solution with caution and consider other models.")
         out$warnings <- warnings
         class(out) <- c("tidyProfile.mclust", "tidyProfile", "list")
         out
     }, this_class = run_models$prof, this_model = run_models$mod, SIMPLIFY = FALSE)
  14: (function (this_class, this_model) 
     {
         out <- list(model = Mclust(full_data, G = this_class, modelNames = ifelse(ncol(full_data) == 
             1, substr(get_modelname(this_model), 1, 1), get_modelname(this_model)), warn = FALSE, 
             verbose = FALSE, ...))
         out$model$mclustBootstrap <- MclustBootstrap(out$model, nboot = 100, type = "bs", 
             verbose = FALSE)
         out$model$LRTS <- ifelse(this_class == 1, NA, boot_blrt[[which(model_numbers == 
             this_model)]]$obs[this_class - 1])
         out$model$LRTS_p <- ifelse(this_class == 1, NA, boot_blrt[[which(model_numbers == 
             this_model)]]$p.value[this_class - 1])
         out$fit <- c(Model = this_model, Classes = this_class, calc_fitindices(out$model))
         estimates <- estimates(out$model)
         estimates$Model <- this_model
         estimates$Classes <- this_class
         if (this_class == 1) {
             estimates$se[estimates$Category == "Means"] <- estimates$Estimate[estimates$Category == 
                 "Variances"]/out$model$n
             estimates$se[estimates$Category == "Variances"] <- sapply(sqrt(estimates$Estimate[estimates$Category == 
                 "Variances"]), se_s, n = out$model$n)^2
             estimates$p <- stats::pnorm(abs(estimates$Estimate), sd = estimates$se, lower.tail = FALSE)
         }
         out$estimates <- estimates
         outdat <- cbind(out$model$z, out$model$classification)
         dff <- matrix(NA, dim(df)[1], dim(outdat)[2])
         dff[no_na_rows, ] <- outdat
         colnames(dff) <- c(paste0("CPROB", 1:ncol(out$model$z)), "Class")
         out$dff <- as_tibble(cbind(df, dff))
         out$dff$model_number <- this_model
         out$dff$classes_number <- this_class
         out$dff <- out$dff[, c((ncol(out$dff) - 1), ncol(out$dff), 1:(ncol(out$dff) - 
             2))]
         warnings <- NULL
         if (out$fit[["prob_min"]] < 0.001) 
             warnings <- c(warnings, "Some classes were not assigned any cases with more than .1% probability. Consequently, these solutions are effectively identical to a solution with one class less.")
         if (out$fit[["n_min"]] < 0.01) 
             warnings <- c(warnings, "Less than 1% of cases were assigned to one of the profiles. Interpret this solution with caution and consider other models.")
         out$warnings <- warnings
         class(out) <- c("tidyProfile.mclust", "tidyProfile", "list")
         out
     })(this_class = dots[[1L]][[6L]], this_model = dots[[2L]][[6L]])
  15: MclustBootstrap(out$model, nboot = 100, type = "bs", verbose = FALSE)
  16: stop("object must be of class 'Mclust' or 'densityMclust'")
  
  == testthat results  ===========================================================
  OK: 20 SKIPPED: 13 FAILED: 1
  1. Error: (unknown) (@test-compare-solutions.R#10) 
  
  Error: testthat unit tests failed
  Execution halted