Running ‘testthat.R’ [8s/9s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(embed)
  Loading required package: recipes
  Loading required package: 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
  
  
  Attaching package: 'recipes'
  
  The following object is masked from 'package:stats':
  
      step
  
  > 
  > test_check(package = "embed")
  ── 1. Error: factor encoded predictor (@test_mixed.R#12)  ──────────────────────
  argument "newdata" is missing, with no default
  1: recipe(x2 ~ ., data = ex_dat) %>% step_lencode_mixed(x3, outcome = vars(x2)) %>% 
         prep(training = ex_dat, retain = TRUE) at testthat/test_mixed.R:12
  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: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: prep(., training = ex_dat, retain = TRUE)
  10: prep.recipe(., training = ex_dat, retain = TRUE)
  11: bake(x$steps[[i]], new_data = training)
  12: bake.step_lencode_mixed(x$steps[[i]], new_data = training)
  13: map_lme_coef(newdata[, col], object$mapping[[col]])
  14: dat %>% mutate(..order = 1:nrow(dat)) %>% set_names(c("..level", "..order")) %>% 
         mutate(..level = as.character(..level))
  15: eval(lhs, parent, parent)
  16: eval(lhs, parent, parent)
  
  ── 2. Error: character encoded predictor (@test_mixed.R#68)  ───────────────────
  argument "newdata" is missing, with no default
  1: recipe(x2 ~ ., data = ex_dat_ch) %>% step_lencode_mixed(x3, outcome = vars(x2)) %>% 
         prep(training = ex_dat_ch, retain = TRUE) at testthat/test_mixed.R:68
  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: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: prep(., training = ex_dat_ch, retain = TRUE)
  10: prep.recipe(., training = ex_dat_ch, retain = TRUE)
  11: bake(x$steps[[i]], new_data = training)
  12: bake.step_lencode_mixed(x$steps[[i]], new_data = training)
  13: map_lme_coef(newdata[, col], object$mapping[[col]])
  14: dat %>% mutate(..order = 1:nrow(dat)) %>% set_names(c("..level", "..order")) %>% 
         mutate(..level = as.character(..level))
  15: eval(lhs, parent, parent)
  16: eval(lhs, parent, parent)
  
  ── 3. Error: factor encoded predictor (@test_mixed.R#127)  ─────────────────────
  argument "newdata" is missing, with no default
  1: recipe(x1 ~ ., data = ex_dat) %>% step_lencode_mixed(x3, outcome = vars(x1)) %>% 
         prep(training = ex_dat, retain = TRUE) at testthat/test_mixed.R:127
  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: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: prep(., training = ex_dat, retain = TRUE)
  10: prep.recipe(., training = ex_dat, retain = TRUE)
  11: bake(x$steps[[i]], new_data = training)
  12: bake.step_lencode_mixed(x$steps[[i]], new_data = training)
  13: map_lme_coef(newdata[, col], object$mapping[[col]])
  14: dat %>% mutate(..order = 1:nrow(dat)) %>% set_names(c("..level", "..order")) %>% 
         mutate(..level = as.character(..level))
  15: eval(lhs, parent, parent)
  16: eval(lhs, parent, parent)
  
  ── 4. Error: character encoded predictor (@test_mixed.R#183)  ──────────────────
  argument "newdata" is missing, with no default
  1: recipe(x1 ~ ., data = ex_dat_ch) %>% step_lencode_mixed(x3, outcome = vars(x1)) %>% 
         prep(training = ex_dat_ch, retain = TRUE) at testthat/test_mixed.R:183
  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: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: prep(., training = ex_dat_ch, retain = TRUE)
  10: prep.recipe(., training = ex_dat_ch, retain = TRUE)
  11: bake(x$steps[[i]], new_data = training)
  12: bake.step_lencode_mixed(x$steps[[i]], new_data = training)
  13: map_lme_coef(newdata[, col], object$mapping[[col]])
  14: dat %>% mutate(..order = 1:nrow(dat)) %>% set_names(c("..level", "..order")) %>% 
         mutate(..level = as.character(..level))
  15: eval(lhs, parent, parent)
  16: eval(lhs, parent, parent)
  
  ── 5. Error: printing (@test_mixed.R#259)  ─────────────────────────────────────
  argument "newdata" is missing, with no default
  1: expect_output(prep(print_test, training = ex_dat_ch, verbose = TRUE)) at testthat/test_mixed.R:259
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: prep(print_test, training = ex_dat_ch, verbose = TRUE)
  11: prep.recipe(print_test, training = ex_dat_ch, verbose = TRUE)
  12: bake(x$steps[[i]], new_data = training)
  13: bake.step_lencode_mixed(x$steps[[i]], new_data = training)
  14: map_lme_coef(newdata[, col], object$mapping[[col]])
  15: dat %>% mutate(..order = 1:nrow(dat)) %>% set_names(c("..level", "..order")) %>% 
         mutate(..level = as.character(..level))
  16: eval(lhs, parent, parent)
  17: eval(lhs, parent, parent)
  
  ── 6. Error: factor encoded predictor (@test_no_pooling.R#12)  ─────────────────
  argument "newdata" is missing, with no default
  1: recipe(x2 ~ ., data = ex_dat) %>% step_lencode_glm(x3, outcome = vars(x2)) %>% prep(training = ex_dat, 
         retain = TRUE) at testthat/test_no_pooling.R:12
  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: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: prep(., training = ex_dat, retain = TRUE)
  10: prep.recipe(., training = ex_dat, retain = TRUE)
  11: bake(x$steps[[i]], new_data = training)
  12: bake.step_lencode_glm(x$steps[[i]], new_data = training)
  13: map_glm_coef(newdata[, col], object$mapping[[col]])
  14: dat %>% mutate(..order = 1:nrow(dat)) %>% set_names(c("..level", "..order")) %>% 
         mutate(..level = as.character(..level))
  15: eval(lhs, parent, parent)
  16: eval(lhs, parent, parent)
  
  ── 7. Error: character encoded predictor (@test_no_pooling.R#68)  ──────────────
  argument "newdata" is missing, with no default
  1: recipe(x2 ~ ., data = ex_dat_ch) %>% step_lencode_glm(x3, outcome = vars(x2)) %>% 
         prep(training = ex_dat_ch, retain = TRUE) at testthat/test_no_pooling.R:68
  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: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: prep(., training = ex_dat_ch, retain = TRUE)
  10: prep.recipe(., training = ex_dat_ch, retain = TRUE)
  11: bake(x$steps[[i]], new_data = training)
  12: bake.step_lencode_glm(x$steps[[i]], new_data = training)
  13: map_glm_coef(newdata[, col], object$mapping[[col]])
  14: dat %>% mutate(..order = 1:nrow(dat)) %>% set_names(c("..level", "..order")) %>% 
         mutate(..level = as.character(..level))
  15: eval(lhs, parent, parent)
  16: eval(lhs, parent, parent)
  
  ── 8. Error: factor encoded predictor (@test_no_pooling.R#127)  ────────────────
  argument "newdata" is missing, with no default
  1: recipe(x1 ~ ., data = ex_dat) %>% step_lencode_glm(x3, outcome = vars(x1)) %>% prep(training = ex_dat, 
         retain = TRUE) at testthat/test_no_pooling.R:127
  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: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: prep(., training = ex_dat, retain = TRUE)
  10: prep.recipe(., training = ex_dat, retain = TRUE)
  11: bake(x$steps[[i]], new_data = training)
  12: bake.step_lencode_glm(x$steps[[i]], new_data = training)
  13: map_glm_coef(newdata[, col], object$mapping[[col]])
  14: dat %>% mutate(..order = 1:nrow(dat)) %>% set_names(c("..level", "..order")) %>% 
         mutate(..level = as.character(..level))
  15: eval(lhs, parent, parent)
  16: eval(lhs, parent, parent)
  
  ── 9. Error: character encoded predictor (@test_no_pooling.R#183)  ─────────────
  argument "newdata" is missing, with no default
  1: recipe(x1 ~ ., data = ex_dat_ch) %>% step_lencode_glm(x3, outcome = vars(x1)) %>% 
         prep(training = ex_dat_ch, retain = TRUE) at testthat/test_no_pooling.R:183
  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: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: prep(., training = ex_dat_ch, retain = TRUE)
  10: prep.recipe(., training = ex_dat_ch, retain = TRUE)
  11: bake(x$steps[[i]], new_data = training)
  12: bake.step_lencode_glm(x$steps[[i]], new_data = training)
  13: map_glm_coef(newdata[, col], object$mapping[[col]])
  14: dat %>% mutate(..order = 1:nrow(dat)) %>% set_names(c("..level", "..order")) %>% 
         mutate(..level = as.character(..level))
  15: eval(lhs, parent, parent)
  16: eval(lhs, parent, parent)
  
  ── 10. Error: printing (@test_no_pooling.R#259)  ───────────────────────────────
  argument "newdata" is missing, with no default
  1: expect_output(prep(print_test, training = ex_dat_ch, verbose = TRUE)) at testthat/test_no_pooling.R:259
  2: quasi_capture(enquo(object), capture_output, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: capture_output_lines(code, print, width = width)
  5: eval_with_output(code, print = print, width = width)
  6: withr::with_output_sink(temp, withVisible(code))
  7: force(code)
  8: withVisible(code)
  9: eval_bare(get_expr(quo), get_env(quo))
  10: prep(print_test, training = ex_dat_ch, verbose = TRUE)
  11: prep.recipe(print_test, training = ex_dat_ch, verbose = TRUE)
  12: bake(x$steps[[i]], new_data = training)
  13: bake.step_lencode_glm(x$steps[[i]], new_data = training)
  14: map_glm_coef(newdata[, col], object$mapping[[col]])
  15: dat %>% mutate(..order = 1:nrow(dat)) %>% set_names(c("..level", "..order")) %>% 
         mutate(..level = as.character(..level))
  16: eval(lhs, parent, parent)
  17: eval(lhs, parent, parent)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 4 SKIPPED: 10 FAILED: 10
  1.  Error: factor encoded predictor (@test_mixed.R#12) 
  2.  Error: character encoded predictor (@test_mixed.R#68) 
  3.  Error: factor encoded predictor (@test_mixed.R#127) 
  4.  Error: character encoded predictor (@test_mixed.R#183) 
  5.  Error: printing (@test_mixed.R#259) 
  6.  Error: factor encoded predictor (@test_no_pooling.R#12) 
  7.  Error: character encoded predictor (@test_no_pooling.R#68) 
  8.  Error: factor encoded predictor (@test_no_pooling.R#127) 
  9.  Error: character encoded predictor (@test_no_pooling.R#183) 
  10. Error: printing (@test_no_pooling.R#259) 
  
  Error: testthat unit tests failed
  Execution halted