Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(janitor)
  > 
  > test_check("janitor")
  ── 1. Error: default call is correct (@test-adorn-crosstab.R#11)  ──────────────
  object 'pasted' not found
  1: expect_equal(adorn_crosstab(source1), data.frame(gear = c("3", "4", "5"), `4` = c("6.7% (1)", 
         "66.7% (8)", "40.0% (2)"), `6` = c("13.3% (2)", "33.3% (4)", "20.0% (1)"), `8` = c("80.0% (12)", 
         "0.0%  (0)", "40.0%  (2)"), check.names = FALSE, stringsAsFactors = FALSE)) at testthat/test-adorn-crosstab.R:11
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: adorn_crosstab(source1)
  5: paste_ns(percs, dat)
  6: paste(perc_matrix, " (", n_matrix, ")", sep = "") %>% sapply(., fix_parens_whitespace) %>% 
         matrix(., nrow = nrow(n_matrix), dimnames = dimnames(perc_matrix)) %>% dplyr::as_data_frame(pasted)
  7: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: `_fseq`(`_lhs`)
  11: freduce(value, `_function_list`)
  12: withVisible(function_list[[k]](value))
  13: function_list[[k]](value)
  14: dplyr::as_data_frame(., pasted)
  15: as_data_frame.matrix(., pasted)
  16: as_tibble(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  17: as_tibble.data.frame(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  18: list_to_tibble(x, validate)
  
  ── 2. Error: percentages are correct (@test-adorn-crosstab.R#21)  ──────────────
  object 'pasted' not found
  1: expect_equal(adorn_crosstab(source1, "col"), data.frame(gear = c("3", "4", "5"), 
         `4` = c("9.1% (1)", "72.7% (8)", "18.2% (2)"), `6` = c("28.6% (2)", "57.1% (4)", 
             "14.3% (1)"), `8` = c("85.7% (12)", "0.0%  (0)", "14.3%  (2)"), check.names = FALSE, 
         stringsAsFactors = FALSE)) at testthat/test-adorn-crosstab.R:21
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: adorn_crosstab(source1, "col")
  5: paste_ns(percs, dat)
  6: paste(perc_matrix, " (", n_matrix, ")", sep = "") %>% sapply(., fix_parens_whitespace) %>% 
         matrix(., nrow = nrow(n_matrix), dimnames = dimnames(perc_matrix)) %>% dplyr::as_data_frame(pasted)
  7: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: `_fseq`(`_lhs`)
  11: freduce(value, `_function_list`)
  12: withVisible(function_list[[k]](value))
  13: function_list[[k]](value)
  14: dplyr::as_data_frame(., pasted)
  15: as_data_frame.matrix(., pasted)
  16: as_tibble(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  17: as_tibble.data.frame(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  18: list_to_tibble(x, validate)
  
  ── 3. Error: rounding is correct (@test-adorn-crosstab.R#39)  ──────────────────
  object 'pasted' not found
  1: mtcars %>% crosstab(cyl, am) %>% adorn_crosstab(., denom = "all", digits = 0, rounding = "half up") at testthat/test-adorn-crosstab.R:39
  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: adorn_crosstab(., denom = "all", digits = 0, rounding = "half up")
  10: paste_ns(percs, dat)
  ...
  14: eval(quote(`_fseq`(`_lhs`)), env, env)
  15: `_fseq`(`_lhs`)
  16: freduce(value, `_function_list`)
  17: withVisible(function_list[[k]](value))
  18: function_list[[k]](value)
  19: dplyr::as_data_frame(., pasted)
  20: as_data_frame.matrix(., pasted)
  21: as_tibble(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  22: as_tibble.data.frame(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  23: list_to_tibble(x, validate)
  
  ── 4. Error: digits parameter is correct (@test-adorn-crosstab.R#64)  ──────────
  object 'pasted' not found
  1: mtcars %>% crosstab(carb, gear) %>% adorn_crosstab(denom = "row", digits = 0) at testthat/test-adorn-crosstab.R:64
  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: adorn_crosstab(., denom = "row", digits = 0)
  10: paste_ns(percs, dat)
  ...
  14: eval(quote(`_fseq`(`_lhs`)), env, env)
  15: `_fseq`(`_lhs`)
  16: freduce(value, `_function_list`)
  17: withVisible(function_list[[k]](value))
  18: function_list[[k]](value)
  19: dplyr::as_data_frame(., pasted)
  20: as_data_frame.matrix(., pasted)
  21: as_tibble(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  22: as_tibble.data.frame(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  23: list_to_tibble(x, validate)
  
  ── 5. Error: spacing is correct (@test-adorn-crosstab.R#86)  ───────────────────
  object 'pasted' not found
  1: data_frame(x = c(rep("a", 500), "b", "b", "c", "d"), y = rep(c(0, 0, 0, 0, 0, 1), 
         84)) %>% crosstab(x, y) %>% adorn_crosstab(denom = "all") at testthat/test-adorn-crosstab.R:86
  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: adorn_crosstab(., denom = "all")
  10: paste_ns(percs, dat)
  ...
  14: eval(quote(`_fseq`(`_lhs`)), env, env)
  15: `_fseq`(`_lhs`)
  16: freduce(value, `_function_list`)
  17: withVisible(function_list[[k]](value))
  18: function_list[[k]](value)
  19: dplyr::as_data_frame(., pasted)
  20: as_data_frame.matrix(., pasted)
  21: as_tibble(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  22: as_tibble.data.frame(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  23: list_to_tibble(x, validate)
  
  ── 6. Error: totals row and columns are correct (@test-adorn-crosstab.R#103)  ──
  object 'pasted' not found
  1: expect_equal(adorn_crosstab(source1, show_totals = TRUE), data.frame(gear = c(3, 
         4, 5, "Total"), `4` = c("6.7%  (1)", "66.7%  (8)", "40.0%  (2)", "34.4% (11)"), 
         `6` = c("13.3% (2)", "33.3% (4)", "20.0% (1)", "21.9% (7)"), `8` = c("80.0% (12)", 
             "0.0%  (0)", "40.0%  (2)", "43.8% (14)"), check.names = FALSE, stringsAsFactors = FALSE)) at testthat/test-adorn-crosstab.R:103
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: adorn_crosstab(source1, show_totals = TRUE)
  5: paste_ns(percs, dat)
  6: paste(perc_matrix, " (", n_matrix, ")", sep = "") %>% sapply(., fix_parens_whitespace) %>% 
         matrix(., nrow = nrow(n_matrix), dimnames = dimnames(perc_matrix)) %>% dplyr::as_data_frame(pasted)
  7: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: `_fseq`(`_lhs`)
  11: freduce(value, `_function_list`)
  12: withVisible(function_list[[k]](value))
  13: function_list[[k]](value)
  14: dplyr::as_data_frame(., pasted)
  15: as_data_frame.matrix(., pasted)
  16: as_tibble(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  17: as_tibble.data.frame(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  18: list_to_tibble(x, validate)
  
  ── 7. Error: Totals works with factor column (@test-adorn-crosstab.R#132)  ─────
  object 'pasted' not found
  1: expect_equal(adorn_crosstab(df1, denom = "row", show_totals = TRUE), data.frame(x = c("big", 
         "small", "Total"), y = c("9.1% (1)", "15.4% (2)", "12.5% (3)"), z = c("90.9% (10)", 
         "84.6% (11)", "87.5% (21)"), stringsAsFactors = FALSE)) at testthat/test-adorn-crosstab.R:132
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: adorn_crosstab(df1, denom = "row", show_totals = TRUE)
  5: paste_ns(percs, dat)
  6: paste(perc_matrix, " (", n_matrix, ")", sep = "") %>% sapply(., fix_parens_whitespace) %>% 
         matrix(., nrow = nrow(n_matrix), dimnames = dimnames(perc_matrix)) %>% dplyr::as_data_frame(pasted)
  7: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: `_fseq`(`_lhs`)
  11: freduce(value, `_function_list`)
  12: withVisible(function_list[[k]](value))
  13: function_list[[k]](value)
  14: dplyr::as_data_frame(., pasted)
  15: as_data_frame.matrix(., pasted)
  16: as_tibble(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  17: as_tibble.data.frame(repair_names(matrixToDataFrame(x)), ..., rownames = rownames)
  18: list_to_tibble(x, validate)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 221 SKIPPED: 0 FAILED: 7
  1. Error: default call is correct (@test-adorn-crosstab.R#11) 
  2. Error: percentages are correct (@test-adorn-crosstab.R#21) 
  3. Error: rounding is correct (@test-adorn-crosstab.R#39) 
  4. Error: digits parameter is correct (@test-adorn-crosstab.R#64) 
  5. Error: spacing is correct (@test-adorn-crosstab.R#86) 
  6. Error: totals row and columns are correct (@test-adorn-crosstab.R#103) 
  7. Error: Totals works with factor column (@test-adorn-crosstab.R#132) 
  
  Error: testthat unit tests failed
  Execution halted