Running ‘testthat.R’ [19s/23s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(dplyr)
  
  Attaching package: 'dplyr'
  
  The following object is masked from 'package:testthat':
  
      matches
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  > library(powerlmm)
  > library(lme4)
  Loading required package: Matrix
  > 
  > test_check("powerlmm")
  ── 1. Error: power (@tests.power.R#21)  ────────────────────────────────────────
  replacement has 1 row, data has 0
  1: get_power(paras) at testthat/tests.power.R:21
  2: get_power.plcp_multi(paras)
  3: loop_power(object = object, df = df, alpha = alpha, nr = nr, progress = progress, 
         progress_inner = progress_inner, R = R)
  4: multi_power_worker(object = p, df = df, alpha = alpha, R = R, progress = progress_inner, 
         ...)
  5: get_power.plcp(object, df = df, alpha = alpha, R = R, ...)
  6: power_fun(i)
  7: simulate_data(prepped)
  8: simulate_data.plcp(prepped)
  9: create_dropout_indicator(paras)
  10: dropout_process(unlist(paras$dropout), paras)
  11: make_dropout_indicator(time, retention, tot_n)
  12: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  13: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  14: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 2. Error: power (@tests.power.R#60)  ────────────────────────────────────────
  replacement has 1 row, data has 0
  1: get_power(paras) at testthat/tests.power.R:60
  2: get_power.plcp_multi(paras)
  3: loop_power(object = object, df = df, alpha = alpha, nr = nr, progress = progress, 
         progress_inner = progress_inner, R = R)
  4: multi_power_worker(object = p, df = df, alpha = alpha, R = R, progress = progress_inner, 
         ...)
  5: get_power.plcp(object, df = df, alpha = alpha, R = R, ...)
  6: power_fun(i)
  7: simulate_data(prepped)
  8: simulate_data.plcp(prepped)
  9: create_dropout_indicator(paras)
  10: dropout_process(unlist(paras$dropout), paras)
  11: make_dropout_indicator(time, retention, tot_n)
  12: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  13: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  14: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 3. Error: power (@tests.power.R#100)  ───────────────────────────────────────
  replacement has 1 row, data has 0
  1: get_power(paras) at testthat/tests.power.R:100
  2: get_power.plcp_multi(paras)
  3: loop_power(object = object, df = df, alpha = alpha, nr = nr, progress = progress, 
         progress_inner = progress_inner, R = R)
  4: multi_power_worker(object = p, df = df, alpha = alpha, R = R, progress = progress_inner, 
         ...)
  5: get_power.plcp(object, df = df, alpha = alpha, R = R, ...)
  6: power_fun(i)
  7: simulate_data(prepped)
  8: simulate_data.plcp(prepped)
  9: create_dropout_indicator(paras)
  10: dropout_process(unlist(paras$dropout), paras)
  11: make_dropout_indicator(time, retention, tot_n)
  12: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  13: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  14: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 4. Error: power (@tests.power.R#282)  ───────────────────────────────────────
  replacement has 1 row, data has 0
  1: get_power(paras) at testthat/tests.power.R:282
  2: get_power.plcp_multi(paras)
  3: loop_power(object = object, df = df, alpha = alpha, nr = nr, progress = progress, 
         progress_inner = progress_inner, R = R)
  4: multi_power_worker(object = p, df = df, alpha = alpha, R = R, progress = progress_inner, 
         ...)
  5: get_power.plcp(object, df = df, alpha = alpha, R = R, ...)
  6: power_fun(i)
  7: simulate_data(prepped)
  8: simulate_data.plcp(prepped)
  9: create_dropout_indicator(paras)
  10: dropout_process(unlist(paras$dropout), paras)
  11: make_dropout_indicator(time, retention, tot_n)
  12: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  13: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  14: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 5. Error: power (@tests.power.R#320)  ───────────────────────────────────────
  replacement has 1 row, data has 0
  1: get_power(paras) at testthat/tests.power.R:320
  2: get_power.plcp_multi(paras)
  3: loop_power(object = object, df = df, alpha = alpha, nr = nr, progress = progress, 
         progress_inner = progress_inner, R = R)
  4: multi_power_worker(object = p, df = df, alpha = alpha, R = R, progress = progress_inner, 
         ...)
  5: get_power.plcp(object, df = df, alpha = alpha, R = R, ...)
  6: power_fun(i)
  7: simulate_data(prepped)
  8: simulate_data.plcp(prepped)
  9: create_dropout_indicator(paras)
  10: dropout_process(unlist(paras$dropout), paras)
  11: make_dropout_indicator(time, retention, tot_n)
  12: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  13: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  14: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 6. Error: power (@tests.power.R#358)  ───────────────────────────────────────
  replacement has 1 row, data has 0
  1: get_power(paras) at testthat/tests.power.R:358
  2: get_power.plcp_multi(paras)
  3: loop_power(object = object, df = df, alpha = alpha, nr = nr, progress = progress, 
         progress_inner = progress_inner, R = R)
  4: multi_power_worker(object = p, df = df, alpha = alpha, R = R, progress = progress_inner, 
         ...)
  5: get_power.plcp(object, df = df, alpha = alpha, R = R, ...)
  6: power_fun(i)
  7: simulate_data(prepped)
  8: simulate_data.plcp(prepped)
  9: create_dropout_indicator(paras)
  10: dropout_process(unlist(paras$dropout), paras)
  11: make_dropout_indicator(time, retention, tot_n)
  12: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  13: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  14: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 7. Error: power partially nested (@tests.power.R#542)  ──────────────────────
  replacement has 1 row, data has 0
  1: get_power(paras) at testthat/tests.power.R:542
  2: get_power.plcp(paras)
  3: power_fun(i)
  4: simulate_data(prepped)
  5: simulate_data.plcp(prepped)
  6: create_dropout_indicator(paras)
  7: dropout_process(unlist(paras$dropout), paras)
  8: make_dropout_indicator(time, retention, tot_n)
  9: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  10: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  11: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 8. Error: G matrices (@tests.power_satterth_df.R#52)  ───────────────────────
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.power_satterth_df.R:52
  2: simulate_data.plcp(p)
  3: create_dropout_indicator(paras)
  4: dropout_process(unlist(paras$dropout), paras)
  5: make_dropout_indicator(time, retention, tot_n)
  6: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  7: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 9. Error: satterth df 2lvl (@tests.power_satterth_df.R#288)  ────────────────
  replacement has 1 row, data has 0
  1: get_power(p) at testthat/tests.power_satterth_df.R:288
  2: get_power.plcp_multi(p)
  3: loop_power(object = object, df = df, alpha = alpha, nr = nr, progress = progress, 
         progress_inner = progress_inner, R = R)
  4: multi_power_worker(object = p, df = df, alpha = alpha, R = R, progress = progress_inner, 
         ...)
  5: get_power.plcp(object, df = df, alpha = alpha, R = R, ...)
  6: power_fun(i)
  7: simulate_data(prepped)
  8: simulate_data.plcp(prepped)
  9: create_dropout_indicator(paras)
  10: dropout_process(unlist(paras$dropout), paras)
  11: make_dropout_indicator(time, retention, tot_n)
  12: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  13: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  14: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 10. Error: power_table (@tests.power_table.R#37)  ───────────────────────────
  replacement has 1 row, data has 0
  1: get_power_table(paras, n2 = 10:15) at testthat/tests.power_table.R:37
  2: get_power(paras, updateProgress = updateProgress, df = df, alpha = alpha, R = R, 
         cores = cores)
  3: get_power.plcp_multi(paras, updateProgress = updateProgress, df = df, alpha = alpha, 
         R = R, cores = cores)
  4: loop_power(object = object, df = df, alpha = alpha, nr = nr, progress = progress, 
         progress_inner = progress_inner, R = R)
  5: multi_power_worker(object = p, df = df, alpha = alpha, R = R, progress = progress_inner, 
         ...)
  6: get_power.plcp(object, df = df, alpha = alpha, R = R, ...)
  7: power_fun(i)
  8: simulate_data(prepped)
  9: simulate_data.plcp(prepped)
  10: create_dropout_indicator(paras)
  11: dropout_process(unlist(paras$dropout), paras)
  12: make_dropout_indicator(time, retention, tot_n)
  13: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  14: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  15: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 11. Error: power_table 2 pars (@tests.power_table.R#94)  ────────────────────
  replacement has 1 row, data has 0
  1: get_power_table(paras, n2 = 10:11, n3 = 6:8) at testthat/tests.power_table.R:94
  2: get_power(paras, updateProgress = updateProgress, df = df, alpha = alpha, R = R, 
         cores = cores)
  3: get_power.plcp_multi(paras, updateProgress = updateProgress, df = df, alpha = alpha, 
         R = R, cores = cores)
  4: loop_power(object = object, df = df, alpha = alpha, nr = nr, progress = progress, 
         progress_inner = progress_inner, R = R)
  5: multi_power_worker(object = p, df = df, alpha = alpha, R = R, progress = progress_inner, 
         ...)
  6: get_power.plcp(object, df = df, alpha = alpha, R = R, ...)
  7: power_fun(i)
  8: simulate_data(prepped)
  9: simulate_data.plcp(prepped)
  10: create_dropout_indicator(paras)
  11: dropout_process(unlist(paras$dropout), paras)
  12: make_dropout_indicator(time, retention, tot_n)
  13: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  14: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  15: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 12. Error: power_table partially nested (@tests.power_table.R#151)  ─────────
  replacement has 1 row, data has 0
  1: get_power_table(paras, n2 = 2:5, partially_nested = c(TRUE, FALSE), df = 8) at testthat/tests.power_table.R:151
  2: get_power(paras, updateProgress = updateProgress, df = df, alpha = alpha, R = R, 
         cores = cores)
  3: get_power.plcp_multi(paras, updateProgress = updateProgress, df = df, alpha = alpha, 
         R = R, cores = cores)
  4: loop_power(object = object, df = df, alpha = alpha, nr = nr, progress = progress, 
         progress_inner = progress_inner, R = R)
  5: multi_power_worker(object = p, df = df, alpha = alpha, R = R, progress = progress_inner, 
         ...)
  6: get_power.plcp(object, df = df, alpha = alpha, R = R, ...)
  7: power_fun(i)
  8: simulate_data(prepped)
  9: simulate_data.plcp(prepped)
  10: create_dropout_indicator(paras)
  11: dropout_process(unlist(paras$dropout), paras)
  12: make_dropout_indicator(time, retention, tot_n)
  13: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  14: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  15: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 13. Error: sim LRT (@tests.simulate_LRT.R#85)  ──────────────────────────────
  replacement has 1 row, data has 0
  1: simulate(p, formula = f, nsim = 4, satterthwaite = FALSE, cores = 1, CI = FALSE) at testthat/tests.simulate_LRT.R:85
  2: simulate.plcp(p, formula = f, nsim = 4, satterthwaite = FALSE, cores = 1, CI = FALSE)
  3: simulate.plcp_list(object = object, nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, ...)
  4: munge_results(out)
  5: lapply(RE, rename_random_effects)
  6: FUN(X[[i]], ...)
  7: rename_rr_(.x, match = c("cluster_time", "cluster.1_time", "cluster_time:treatment", 
         "cluster_treatment:time", "cluster.1_treatment:time"), new = "cluster_slope")
  8: `[<-`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_slope")
  9: `[<-.data.frame`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_slope")
  10: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 14. Error: sim LRT multi (@tests.simulate_LRT.R#109)  ───────────────────────
  replacement has 1 row, data has 0
  1: simulate(p, formula = f, nsim = 4, satterthwaite = FALSE, cores = 1, CI = FALSE, 
         batch_progress = FALSE) at testthat/tests.simulate_LRT.R:109
  2: simulate.plcp_multi(p, formula = f, nsim = 4, satterthwaite = FALSE, cores = 1, CI = FALSE, 
         batch_progress = FALSE)
  3: simulate.plcp(object = object, nsim = nsim, seed = NULL, satterthwaite = satterthwaite, 
         CI = CI, formula = formula, cores = cores, progress = progress, batch_progress = batch_progress, 
         ...)
  4: simulate.plcp_data_frame(object = object, nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, batch_progress = batch_progress, 
         ...)
  5: lapply(1:nrow(object), function(i) {
         if (batch_progress) {
             cat("\rBatch: ", i, "/", nrow(object), rep(" ", options()$width - 13))
             cat("\n")
         }
         if (cores > 1 && interactive()) {
             cl <- parallel::makeCluster(cores)
             on.exit(parallel::stopCluster(cl))
         }
         else cl <- NULL
         x <- simulate.plcp_list(as.plcp(object[i, ]), nsim = nsim, formula = formula, 
             satterthwaite = satterthwaite, CI = CI, cores = cores, progress = progress, 
             cl = cl)
         if (save) {
             fname <- paste("sim", i, ".rds", sep = "")
             f <- file.path(output_dir, fname)
             saveRDS(x, f)
         }
         x
     })
  6: FUN(X[[i]], ...)
  7: simulate.plcp_list(as.plcp(object[i, ]), nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, cl = cl)
  8: munge_results(out)
  9: lapply(RE, rename_random_effects)
  10: FUN(X[[i]], ...)
  11: rename_rr_(.x, match = c("cluster_time", "cluster.1_time", "cluster_time:treatment", 
         "cluster_treatment:time", "cluster.1_treatment:time"), new = "cluster_slope")
  12: `[<-`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_slope")
  13: `[<-.data.frame`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_slope")
  14: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 15. Error: number of subjects, uneqal, dropout (@tests.simulate_data.R#37)  ─
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.simulate_data.R:37
  2: simulate_data.plcp(p)
  3: create_dropout_indicator(paras)
  4: dropout_process(unlist(paras$dropout), paras)
  5: make_dropout_indicator(time, retention, tot_n)
  6: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  7: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 16. Error: number of subjects, per_treatment, uneqal, dropout (@tests.simulat
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.simulate_data.R:88
  2: simulate_data.plcp(p)
  3: create_dropout_indicator(paras)
  4: dropout_process(unlist(paras$dropout), paras)
  5: make_dropout_indicator(time, retention, tot_n)
  6: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  7: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 17. Error: number of clusters, per_treatment, dropout (@tests.simulate_data.R
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.simulate_data.R:139
  2: simulate_data.plcp(p)
  3: create_dropout_indicator(paras)
  4: dropout_process(unlist(paras$dropout), paras)
  5: make_dropout_indicator(time, retention, tot_n)
  6: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  7: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 18. Error: number of clusters, per_treatment (@tests.simulate_data.R#168)  ──
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.simulate_data.R:168
  2: simulate_data.plcp(p)
  3: create_dropout_indicator(paras)
  4: dropout_process(unlist(paras$dropout), paras)
  5: make_dropout_indicator(time, retention, tot_n)
  6: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  7: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 19. Error: proportion of dropout (@tests.simulate_data.R#198)  ──────────────
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.simulate_data.R:198
  2: simulate_data.plcp(p)
  3: create_dropout_indicator(paras)
  4: dropout_process(unlist(paras$dropout), paras)
  5: make_dropout_indicator(time, retention, tot_n)
  6: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  7: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 20. Error: proportion of dropout, per_treatment (@tests.simulate_data.R#230) 
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.simulate_data.R:230
  2: simulate_data.plcp(p)
  3: create_dropout_indicator(paras)
  4: dropout_process(unlist(paras$dropout), paras)
  5: make_dropout_indicator(time, retention, tot_n)
  6: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  7: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 21. Error: proportion of dropout, only in control (@tests.simulate_data.R#261
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.simulate_data.R:261
  2: simulate_data.plcp(p)
  3: create_dropout_indicator(paras)
  4: dropout_process(unlist(paras$dropout), paras)
  5: make_dropout_indicator(time, retention, tot_n)
  6: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  7: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 22. Error: proportion of dropout, only in tx (@tests.simulate_data.R#318)  ──
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.simulate_data.R:318
  2: simulate_data.plcp(p)
  3: create_dropout_indicator(paras_tx)
  4: dropout_process(unlist(paras$dropout), paras)
  5: make_dropout_indicator(time, retention, tot_n)
  6: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  7: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 23. Error: proportion of dropout (@tests.simulate_data.R#376)  ──────────────
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.simulate_data.R:376
  2: simulate_data.plcp(p)
  3: create_dropout_indicator(paras)
  4: dropout_process(unlist(paras$dropout), paras)
  5: make_dropout_indicator(time, retention, tot_n)
  6: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  7: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 24. Error: proportion of dropout, per_treatment (@tests.simulate_data.R#411) 
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.simulate_data.R:411
  2: simulate_data.plcp(p)
  3: create_dropout_indicator(paras)
  4: dropout_process(unlist(paras$dropout), paras)
  5: make_dropout_indicator(time, retention, tot_n)
  6: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  7: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 25. Error: multi_para #1 (@tests.simulate_data.R#504)  ──────────────────────
  replacement has 1 row, data has 0
  1: simulate_data(p) at testthat/tests.simulate_data.R:504
  2: simulate_data.plcp_multi(p)
  3: simulate_data.plcp(as.plcp(paras[n, ]))
  4: create_dropout_indicator(paras)
  5: dropout_process(unlist(paras$dropout), paras)
  6: make_dropout_indicator(time, retention, tot_n)
  7: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  8: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  9: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 26. Error: munge_results (@tests.simulation.R#25)  ──────────────────────────
  replacement has 1 row, data has 0
  1: munge_results(list(res = res)) at testthat/tests.simulation.R:25
  2: lapply(RE, rename_random_effects)
  3: FUN(X[[i]], ...)
  4: rename_rr_(.x, match = c("cluster_(Intercept)", "cluster_treatment"), new = "cluster_intercept")
  5: `[<-`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_intercept")
  6: `[<-.data.frame`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_intercept")
  7: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 27. Error: extract results (@tests.simulation.R#67)  ────────────────────────
  replacement has 1 row, data has 0
  1: extract_results(list(list(fit = fit)), CI = FALSE, df_bw = 8, tot_n = 100, sim = 1) at testthat/tests.simulation.R:67
  2: lapply(fit, extract_results_, CI = CI, satterthwaite = satterthwaite, df_bw = df_bw, 
         tot_n = tot_n, sim = sim)
  3: FUN(X[[i]], ...)
  4: `[<-`(`*tmp*`, FE$parameter %in% fit$test, "df_bw", value = 8)
  5: `[<-.data.frame`(`*tmp*`, FE$parameter %in% fit$test, "df_bw", value = 8)
  6: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 28. Error: simulation summary (@tests.simulation.R#94)  ─────────────────────
  replacement has 1 row, data has 0
  1: simulate(p, nsim = 3, formula = formula, satterthwaite = FALSE, progress = FALSE) at testthat/tests.simulation.R:94
  2: simulate.plcp(p, nsim = 3, formula = formula, satterthwaite = FALSE, progress = FALSE)
  3: simulate.plcp_list(object = object, nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, ...)
  4: munge_results(out)
  5: lapply(RE, rename_random_effects)
  6: FUN(X[[i]], ...)
  7: rename_rr_(.x, match = c("cluster_(Intercept)", "cluster_treatment"), new = "cluster_intercept")
  8: `[<-`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_intercept")
  9: `[<-.data.frame`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_intercept")
  10: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 29. Error: simulate with NA para (@tests.simulation.R#179)  ─────────────────
  replacement has 1 row, data has 0
  1: simulate(p, nsim = 2, formula = sim_formula("y ~ time * treatment + (1 | subject) + (1 | cluster)")) at testthat/tests.simulation.R:179
  2: simulate.plcp(p, nsim = 2, formula = sim_formula("y ~ time * treatment + (1 | subject) + (1 | cluster)"))
  3: simulate.plcp_list(object = object, nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, ...)
  4: munge_results(out)
  5: lapply(RE, rename_random_effects)
  6: FUN(X[[i]], ...)
  7: rename_rr_(.x, match = c("cluster_time", "cluster.1_time", "cluster_time:treatment", 
         "cluster_treatment:time", "cluster.1_treatment:time"), new = "cluster_slope")
  8: `[<-`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_slope")
  9: `[<-.data.frame`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_slope")
  10: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 30. Error: simulation summary alpha (@tests.simulation.R#196)  ──────────────
  replacement has 1 row, data has 0
  1: simulate(p, nsim = 10, formula = formula, satterthwaite = FALSE, progress = FALSE) at testthat/tests.simulation.R:196
  2: simulate.plcp(p, nsim = 10, formula = formula, satterthwaite = FALSE, progress = FALSE)
  3: simulate.plcp_list(object = object, nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, ...)
  4: munge_results(out)
  5: lapply(RE, rename_random_effects)
  6: FUN(X[[i]], ...)
  7: rename_rr_(.x, match = c("cluster_time", "cluster.1_time", "cluster_time:treatment", 
         "cluster_treatment:time", "cluster.1_treatment:time"), new = "cluster_slope")
  8: `[<-`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_slope")
  9: `[<-.data.frame`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_slope")
  10: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 31. Error: simulation partially nested (@tests.simulation.R#221)  ───────────
  replacement has 1 row, data has 0
  1: simulate(p, nsim = 3, formula = formula, satterthwaite = FALSE, progress = FALSE, 
         cores = 1, save = FALSE) at testthat/tests.simulation.R:221
  2: simulate.plcp(p, nsim = 3, formula = formula, satterthwaite = FALSE, progress = FALSE, 
         cores = 1, save = FALSE)
  3: simulate.plcp_list(object = object, nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, ...)
  4: munge_results(out)
  5: lapply(RE, rename_random_effects)
  6: FUN(X[[i]], ...)
  7: rename_rr_(.x, match = c("cluster_(Intercept)", "cluster_treatment"), new = "cluster_intercept")
  8: `[<-`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_intercept")
  9: `[<-.data.frame`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_intercept")
  10: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 32. Error: Simulation runs, unequal_clusters (@tests.simulation.R#315)  ─────
  replacement has 1 row, data has 0
  1: simulate(p, nsim = 2, formula = f, satterthwaite = FALSE, progress = FALSE) at testthat/tests.simulation.R:315
  2: simulate.plcp(p, nsim = 2, formula = f, satterthwaite = FALSE, progress = FALSE)
  3: simulate.plcp_list(object = object, nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, ...)
  4: munge_results(out)
  5: lapply(RE, rename_random_effects)
  6: FUN(X[[i]], ...)
  7: rename_rr_(.x, match = c("cluster_(Intercept)", "cluster_treatment"), new = "cluster_intercept")
  8: `[<-`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_intercept")
  9: `[<-.data.frame`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_intercept")
  10: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 33. Error: Simulation runs, unequal_clusters (@tests.simulation.R#333)  ─────
  replacement has 1 row, data has 0
  1: simulate(p, nsim = 2, formula = f, satterthwaite = TRUE, CI = TRUE, progress = FALSE) at testthat/tests.simulation.R:333
  2: simulate.plcp(p, nsim = 2, formula = f, satterthwaite = TRUE, CI = TRUE, progress = FALSE)
  3: simulate.plcp_list(object = object, nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, ...)
  4: munge_results(out)
  5: lapply(RE, rename_random_effects)
  6: FUN(X[[i]], ...)
  7: rename_rr_(.x, match = c("cluster_(Intercept)", "cluster_treatment"), new = "cluster_intercept")
  8: `[<-`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_intercept")
  9: `[<-.data.frame`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_intercept")
  10: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 34. Error: Simulation runs, dropout (@tests.simulation.R#351)  ──────────────
  replacement has 1 row, data has 0
  1: simulate(p, nsim = 2, formula = f, satterthwaite = TRUE, progress = FALSE) at testthat/tests.simulation.R:351
  2: simulate.plcp(p, nsim = 2, formula = f, satterthwaite = TRUE, progress = FALSE)
  3: simulate.plcp_list(object = object, nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, ...)
  4: lapply(1:nsim, FUN = simulate_, paras = object, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, ...)
  5: FUN(X[[i]], ...)
  6: simulate_data(prepped)
  7: simulate_data.plcp(prepped)
  8: create_dropout_indicator(paras)
  9: dropout_process(unlist(paras$dropout), paras)
  10: make_dropout_indicator(time, retention, tot_n)
  11: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  12: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  13: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 35. Error: sim data_transform (@tests.simulation.R#371)  ────────────────────
  replacement has 1 row, data has 0
  1: simulate(p, nsim = 2, formula = f) at testthat/tests.simulation.R:371
  2: simulate.plcp(p, nsim = 2, formula = f)
  3: simulate.plcp_list(object = object, nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, ...)
  4: munge_results(out)
  5: lapply(RE, rename_random_effects)
  6: FUN(X[[i]], ...)
  7: rename_rr_(.x, match = c("cluster_time", "cluster.1_time", "cluster_time:treatment", 
         "cluster_treatment:time", "cluster.1_treatment:time"), new = "cluster_slope")
  8: `[<-`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_slope")
  9: `[<-.data.frame`(`*tmp*`, .x$parameter %in% match, "parameter", value = "cluster_slope")
  10: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 36. Error: (unknown) (@tests.simulation_multi.R#20)  ────────────────────────
  replacement has 1 row, data has 0
  1: simulate(paras, nsim = 2, formula = formula, satterthwaite = FALSE, progress = FALSE, 
         batch_progress = FALSE) at testthat/tests.simulation_multi.R:20
  2: simulate.plcp_multi(paras, nsim = 2, formula = formula, satterthwaite = FALSE, progress = FALSE, 
         batch_progress = FALSE)
  3: simulate.plcp(object = object, nsim = nsim, seed = NULL, satterthwaite = satterthwaite, 
         CI = CI, formula = formula, cores = cores, progress = progress, batch_progress = batch_progress, 
         ...)
  4: simulate.plcp_data_frame(object = object, nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, batch_progress = batch_progress, 
         ...)
  5: lapply(1:nrow(object), function(i) {
         if (batch_progress) {
             cat("\rBatch: ", i, "/", nrow(object), rep(" ", options()$width - 13))
             cat("\n")
         }
         if (cores > 1 && interactive()) {
             cl <- parallel::makeCluster(cores)
             on.exit(parallel::stopCluster(cl))
         }
         else cl <- NULL
         x <- simulate.plcp_list(as.plcp(object[i, ]), nsim = nsim, formula = formula, 
             satterthwaite = satterthwaite, CI = CI, cores = cores, progress = progress, 
             cl = cl)
         if (save) {
             fname <- paste("sim", i, ".rds", sep = "")
             f <- file.path(output_dir, fname)
             saveRDS(x, f)
         }
         x
     })
  6: FUN(X[[i]], ...)
  7: simulate.plcp_list(as.plcp(object[i, ]), nsim = nsim, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, cores = cores, progress = progress, cl = cl)
  8: lapply(1:nsim, FUN = simulate_, paras = object, formula = formula, satterthwaite = satterthwaite, 
         CI = CI, ...)
  9: FUN(X[[i]], ...)
  10: simulate_data(prepped)
  11: simulate_data.plcp(prepped)
  12: create_dropout_indicator(paras)
  13: dropout_process(unlist(paras$dropout), paras)
  14: make_dropout_indicator(time, retention, tot_n)
  15: `[<-`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  16: `[<-.data.frame`(`*tmp*`, d$id %in% dropouts & d$time >= time[i], "missing", value = 1)
  17: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 741 SKIPPED: 0 FAILED: 36
  1. Error: power (@tests.power.R#21) 
  2. Error: power (@tests.power.R#60) 
  3. Error: power (@tests.power.R#100) 
  4. Error: power (@tests.power.R#282) 
  5. Error: power (@tests.power.R#320) 
  6. Error: power (@tests.power.R#358) 
  7. Error: power partially nested (@tests.power.R#542) 
  8. Error: G matrices (@tests.power_satterth_df.R#52) 
  9. Error: satterth df 2lvl (@tests.power_satterth_df.R#288) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted