Skip to content

Commit

Permalink
Fix warnings in R CMD Check
Browse files Browse the repository at this point in the history
  • Loading branch information
haziqj committed Mar 21, 2024
1 parent 4b46d65 commit 7c1e151
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions R/50-sim_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,18 @@ run_ligof_sims <- function(model_no = 1, nsim = 1000, samp_size = 1000,
"strat2"),
simtype = c("type1", "power"), starting_seed = 16423,
ncores = parallel::detectCores() - 2,
pop_Sigma = FALSE, Sigma2 = NULL, the_wt = NULL) {
pop_Sigma = FALSE, Sigma2 = NULL) {

# Model setup ----------------------------------------------------------------
mod <- txt_mod(model_no)
simtype <- match.arg(simtype, c("type1", "power"))
if (simtype == "type1") H1 <- FALSE
if (simtype == "power") H1 <- TRUE
samp <- match.arg(samp, c("srs", "wtd", "strat", "clust", "strcl", "strat2"))

the_wt <- NULL
if (samp != "srs") {
# the_wt <- "wt"
the_wt <- "wt"
pop <- make_population(model_no, seed = starting_seed, H1 = H1,
Sigma2_attr = isTRUE(pop_Sigma))
Sigma2pop <- attr(pop, "Sigma2")
Expand Down
2 changes: 1 addition & 1 deletion R/51-sim_functions_alt.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ run_ligof_sims_alt <- function(model_no = 1, nsim = 1000, Sigma2 = NULL,
.errorhandling = "pass",
.options.snow = list(progress = progress)
) %dopar% {
dat <- lavaan.bingof:::get_samp(pop = pop)
dat <- get_samp(pop = pop)
fit <- lavaan::sem(model = txt_mod(model_no), data = dat, estimator = "PML",
std.lv = TRUE, sampling.weights = the_wt)
all_tests(fit, sim = i, Sigma2 = Sigma2)
Expand Down

0 comments on commit 7c1e151

Please sign in to comment.