Running ‘testthat.R’ [7s/8s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(janitor)
  > 
  > test_check("janitor")
  ── 1. Error: totals row is correct (@test-add-totals.R#18)  ────────────────────
  replacement has 3 rows, data has 2
  1: expect_equal(untabyl(adorn_totals(ct, "row")), data.frame(a = c("big", "small", "Total"), 
         `1` = c(4, 1, 5), `2` = c(0, 2, 2), `3` = c(2, 0, 2), check.names = FALSE, stringsAsFactors = FALSE)) at testthat/test-add-totals.R:18
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: untabyl(adorn_totals(ct, "row"))
  5: "tabyl" %in% class(dat)
  6: adorn_totals(ct, "row")
  7: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", `1` = 5, `2` = 2, 
         `3` = 2), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  8: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", 
         `1` = 5, `2` = 2, `3` = 2), row.names = c(NA, -1L), class = c("tbl_df", "tbl", 
     "data.frame")))
  9: xpdrows.data.frame(x, rows, new.rows)
  10: `[[<-`(`*tmp*`, i, value = c("big", "small", NA))
  11: `[[<-.data.frame`(`*tmp*`, i, value = c("big", "small", NA))
  12: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 2. Error: totals row and col produce correct results when called together (@t
  replacement has 3 rows, data has 2
  1: expect_equal(ct %>% adorn_totals(c("row", "col")) %>% untabyl(), data.frame(a = c("big", 
         "small", "Total"), `1` = c(4, 1, 5), `2` = c(0, 2, 2), `3` = c(2, 0, 2), Total = c(6, 
         3, 9), check.names = FALSE, stringsAsFactors = FALSE)) at testthat/test-add-totals.R:49
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ct %>% adorn_totals(c("row", "col")) %>% untabyl()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: function_list[[i]](value)
  11: adorn_totals(., c("row", "col"))
  12: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", `1` = 5, `2` = 2, 
         `3` = 2), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  13: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", 
         `1` = 5, `2` = 2, `3` = 2), row.names = c(NA, -1L), class = c("tbl_df", "tbl", 
     "data.frame")))
  14: xpdrows.data.frame(x, rows, new.rows)
  15: `[[<-`(`*tmp*`, i, value = c("big", "small", NA))
  16: `[[<-.data.frame`(`*tmp*`, i, value = c("big", "small", NA))
  17: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 3. Error: order doesn't matter when row and col are called together (@test-ad
  replacement has 3 rows, data has 2
  1: expect_equal(ct %>% adorn_totals(c("row", "col")) %>% untabyl(), ct %>% adorn_totals(c("col", 
         "row")) %>% untabyl()) at testthat/test-add-totals.R:66
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ct %>% adorn_totals(c("row", "col")) %>% untabyl()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: function_list[[i]](value)
  11: adorn_totals(., c("row", "col"))
  12: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", `1` = 5, `2` = 2, 
         `3` = 2), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  13: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", 
         `1` = 5, `2` = 2, `3` = 2), row.names = c(NA, -1L), class = c("tbl_df", "tbl", 
     "data.frame")))
  14: xpdrows.data.frame(x, rows, new.rows)
  15: `[[<-`(`*tmp*`, i, value = c("big", "small", NA))
  16: `[[<-.data.frame`(`*tmp*`, i, value = c("big", "small", NA))
  17: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 4. Failure: both functions work with a single column (@test-add-totals.R#81) 
  `single_col %>% adorn_totals("row")` threw an error.
  Message: replacement has 3 rows, data has 2
  Class:   simpleError/error/condition
  
  ── 5. Failure: both functions work with a single column (@test-add-totals.R#83) 
  `single_col %>% adorn_totals(c("col", "row"))` threw an error.
  Message: replacement has 3 rows, data has 2
  Class:   simpleError/error/condition
  
  ── 6. Error: grouped_df gets ungrouped and succeeds (@test-add-totals.R#122)  ──
  replacement has 4 rows, data has 3
  1: expect_equal(ct_2 %>% adorn_totals(), ct_2 %>% ungroup() %>% adorn_totals()) at testthat/test-add-totals.R:122
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ct_2 %>% adorn_totals()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: withVisible(function_list[[k]](value))
  11: function_list[[k]](value)
  12: adorn_totals(.)
  13: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(cyl = "Total", `3` = 15L, 
         `4` = 12L, `5` = 5L), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame"
     )))
  14: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(cyl = "Total", 
         `3` = 15L, `4` = 12L, `5` = 5L), row.names = c(NA, -1L), class = c("tbl_df", 
     "tbl", "data.frame")))
  15: xpdrows.data.frame(x, rows, new.rows)
  16: `[[<-`(`*tmp*`, i, value = c(4, 6, 8, NA))
  17: `[[<-.data.frame`(`*tmp*`, i, value = c(4, 6, 8, NA))
  18: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 7. Error: na.rm value works correctly (@test-add-totals.R#129)  ─────────────
  replacement has 3 rows, data has 2
  1: expect_equal(df1 %>% adorn_totals(c("row", "col"), na.rm = FALSE) %>% untabyl(), 
         data.frame(x = c("1", "2", "Total"), y = c(NA, 4, NA), Total = c(NA, 4, NA), 
             stringsAsFactors = FALSE)) at testthat/test-add-totals.R:129
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: df1 %>% adorn_totals(c("row", "col"), na.rm = FALSE) %>% untabyl()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: function_list[[i]](value)
  11: adorn_totals(., c("row", "col"), na.rm = FALSE)
  12: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", y = NA_real_), row.names = c(NA, 
     -1L), class = c("tbl_df", "tbl", "data.frame")))
  13: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", 
         y = NA_real_), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame"
     )))
  14: xpdrows.data.frame(x, rows, new.rows)
  15: `[[<-`(`*tmp*`, i, value = c(1, 2, NA))
  16: `[[<-.data.frame`(`*tmp*`, i, value = c(1, 2, NA))
  17: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 8. Error: add_totals respects if input was data.frame (@test-add-totals.R#141
  replacement has 3 rows, data has 2
  1: expect_equal(class(df1), class(df1 %>% adorn_totals() %>% untabyl())) at testthat/test-add-totals.R:141
  2: quasi_label(enquo(expected), expected.label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: df1 %>% adorn_totals() %>% untabyl()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: function_list[[i]](value)
  11: adorn_totals(.)
  12: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", y = 4), row.names = c(NA, 
     -1L), class = c("tbl_df", "tbl", "data.frame")))
  13: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", 
         y = 4), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  14: xpdrows.data.frame(x, rows, new.rows)
  15: `[[<-`(`*tmp*`, i, value = c(1, 2, NA))
  16: `[[<-.data.frame`(`*tmp*`, i, value = c(1, 2, NA))
  17: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 9. Error: add_totals respects if input was data_frame (@test-add-totals.R#148
  replacement has 3 rows, data has 2
  1: expect_equal(class(df1 %>% as_data_frame()), class(df1 %>% as_data_frame() %>% adorn_totals() %>% 
         untabyl())) at testthat/test-add-totals.R:148
  2: quasi_label(enquo(expected), expected.label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: df1 %>% as_data_frame() %>% adorn_totals() %>% untabyl()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: function_list[[i]](value)
  11: adorn_totals(.)
  12: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", y = 4), row.names = c(NA, 
     -1L), class = c("tbl_df", "tbl", "data.frame")))
  13: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", 
         y = 4), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  14: xpdrows.data.frame(x, rows, new.rows)
  15: `[[<-`(`*tmp*`, i, value = c(1, 2, NA))
  16: `[[<-.data.frame`(`*tmp*`, i, value = c(1, 2, NA))
  17: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 10. Error: works with non-numeric columns mixed in; fill character specificat
  replacement has 4 rows, data has 3
  1: expect_equal(mixed %>% adorn_totals(where = c("row", "col"), fill = "*") %>% untabyl(), 
         data.frame(a = c("1", "2", "3", "Total"), b = c("x", "y", "z", "*"), c = c(5, 
             6, 7, 18), d = c("big", "med", "small", "*"), Total = c(5, 6, 7, 18), stringsAsFactors = FALSE)) at testthat/test-add-totals.R:192
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: mixed %>% adorn_totals(where = c("row", "col"), fill = "*") %>% untabyl()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: function_list[[i]](value)
  11: adorn_totals(., where = c("row", "col"), fill = "*")
  12: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", b = "*", c = 18L, 
         d = "*"), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  13: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", 
         b = "*", c = 18L, d = "*"), row.names = c(NA, -1L), class = c("tbl_df", "tbl", 
     "data.frame")))
  14: xpdrows.data.frame(x, rows, new.rows)
  15: `[[<-`(`*tmp*`, i, value = c(1L, 2L, 3L, NA))
  16: `[[<-.data.frame`(`*tmp*`, i, value = c(1L, 2L, 3L, NA))
  17: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 11. Error: fill works with multiple factor and date columns (@test-add-totals
  replacement has 3 rows, data has 2
  1: expect_equal(adorn_totals(has_facs, "row") %>% untabyl, data.frame(a = c("hi", "low", 
         "Total"), b = c("big", "small", "-"), c = c("2000-01-01", "2000-01-02", "-"), 
         d = 1:3, stringsAsFactors = FALSE)) at testthat/test-add-totals.R:212
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: adorn_totals(has_facs, "row") %>% untabyl
  5: eval(lhs, parent, parent)
  6: eval(lhs, parent, parent)
  7: adorn_totals(has_facs, "row")
  8: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", b = "-", c = "-", 
         d = 3L), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  9: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", 
         b = "-", c = "-", d = 3L), row.names = c(NA, -1L), class = c("tbl_df", "tbl", 
     "data.frame")))
  10: xpdrows.data.frame(x, rows, new.rows)
  11: `[[<-`(`*tmp*`, i, value = c("hi", "low", NA))
  12: `[[<-.data.frame`(`*tmp*`, i, value = c("hi", "low", NA))
  13: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 12. Error: totals attributes are assigned correctly (@test-add-totals.R#223) 
  replacement has 3 rows, data has 2
  1: adorn_totals(ct, c("row", "col")) at testthat/test-add-totals.R:223
  2: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", `1` = 5, `2` = 2, 
         `3` = 2), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  3: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(a = "Total", 
         `1` = 5, `2` = 2, `3` = 2), row.names = c(NA, -1L), class = c("tbl_df", "tbl", 
     "data.frame")))
  4: xpdrows.data.frame(x, rows, new.rows)
  5: `[[<-`(`*tmp*`, i, value = c("big", "small", NA))
  6: `[[<-.data.frame`(`*tmp*`, i, value = c("big", "small", NA))
  7: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 13. Failure: trying to re-adorn a dimension fails (@test-add-totals.R#242)  ─
  `ct %>% adorn_totals() %>% adorn_totals()` threw an error with unexpected message.
  Expected match: "trying to re-add a totals dimension that is already been added"
  Actual message: "replacement has 3 rows, data has 2"
  
  ── 14. Error: automatically invokes purrr::map when called on a 3-way tabyl (@te
  replacement has 4 rows, data has 3
  1: expect_equal(adorn_totals(three), purrr::map(three, adorn_totals)) at testthat/test-add-totals.R:251
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: adorn_totals(three)
  5: purrr::map(dat, adorn_totals, where, fill, na.rm)
  6: .f(.x[[i]], ...)
  7: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(cyl = "Total", `0` = 15, 
         `1` = 0), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  8: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(cyl = "Total", 
         `0` = 15, `1` = 0), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame"
     )))
  9: xpdrows.data.frame(x, rows, new.rows)
  10: `[[<-`(`*tmp*`, i, value = c(4, 6, 8, NA))
  11: `[[<-.data.frame`(`*tmp*`, i, value = c(4, 6, 8, NA))
  12: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 15. Error: deprecated functions adorn_totals_col and adorn_totals_row functio
  replacement has 33 rows, data has 32
  1: expect_equal(mtcars %>% adorn_totals(), suppressWarnings(mtcars %>% add_totals_row())) at testthat/test-add-totals.R:269
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: mtcars %>% adorn_totals()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: withVisible(function_list[[k]](value))
  11: function_list[[k]](value)
  12: adorn_totals(.)
  13: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(mpg = "Total", cyl = 198, 
         disp = 7383.1, hp = 4694, drat = 115.09, wt = 102.952, qsec = 571.16, vs = 14, 
         am = 13, gear = 118, carb = 90), row.names = c(NA, -1L), class = c("tbl_df", 
     "tbl", "data.frame")))
  14: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(mpg = "Total", 
         cyl = 198, disp = 7383.1, hp = 4694, drat = 115.09, wt = 102.952, qsec = 571.16, 
         vs = 14, am = 13, gear = 118, carb = 90), row.names = c(NA, -1L), class = c("tbl_df", 
     "tbl", "data.frame")))
  15: xpdrows.data.frame(x, rows, new.rows)
  16: `[[<-`(`*tmp*`, i, value = c(21, 21, 22.8, 21.4, 18.7, 18.1, 14.3, 24.4, 22.8, 19.2, 
     17.8, 16.4, 17.3, 15.2, 10.4, 10.4, 14.7, 32.4, 30.4, 33.9, 21.5, 15.5, 15.2, 13.3, 
     19.2, 27.3, 26, 30.4, 15.8, 19.7, 15, 21.4, NA))
  17: `[[<-.data.frame`(`*tmp*`, i, value = c(21, 21, 22.8, 21.4, 18.7, 18.1, 14.3, 24.4, 
     22.8, 19.2, 17.8, 16.4, 17.3, 15.2, 10.4, 10.4, 14.7, 32.4, 30.4, 33.9, 21.5, 15.5, 
     15.2, 13.3, 19.2, 27.3, 26, 30.4, 15.8, 19.7, 15, 21.4, NA))
  18: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 16. Error: totals row and columns are correct (@test-adorn-crosstab.R#107)  ─
  replacement has 4 rows, data has 3
  1: expect_equal(suppressWarnings(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:107
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: suppressWarnings(adorn_crosstab(source1, show_totals = TRUE))
  5: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  6: adorn_crosstab(source1, show_totals = TRUE)
  7: adorn_totals(dat, "row")
  8: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(gear = "Total", `4` = 11, 
         `6` = 7, `8` = 14), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame"
     )))
  9: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(gear = "Total", 
         `4` = 11, `6` = 7, `8` = 14), row.names = c(NA, -1L), class = c("tbl_df", "tbl", 
     "data.frame")))
  10: xpdrows.data.frame(x, rows, new.rows)
  11: `[[<-`(`*tmp*`, i, value = c("3", "4", "5", NA))
  12: `[[<-.data.frame`(`*tmp*`, i, value = c("3", "4", "5", NA))
  13: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 17. Error: Totals works with factor column (@test-adorn-crosstab.R#138)  ────
  replacement has 3 rows, data has 2
  1: expect_equal(suppressWarnings(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:138
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: suppressWarnings(adorn_crosstab(df1, denom = "row", show_totals = TRUE))
  5: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  6: adorn_crosstab(df1, denom = "row", show_totals = TRUE)
  7: adorn_totals(dat, "row")
  8: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", y = 3L, z = 21L), row.names = c(NA, 
     -1L), class = c("tbl_df", "tbl", "data.frame")))
  9: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", 
         y = 3L, z = 21L), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame"
     )))
  10: xpdrows.data.frame(x, rows, new.rows)
  11: `[[<-`(`*tmp*`, i, value = c("big", "small", NA))
  12: `[[<-.data.frame`(`*tmp*`, i, value = c("big", "small", NA))
  13: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 18. Error: spacing is correct (@test-adorn-ns.R#16)  ────────────────────────
  replacement has 5 rows, data has 4
  1: expect_equal(source_an %>% adorn_totals() %>% adorn_percentages("all") %>% adorn_pct_formatting() %>% 
         adorn_ns() %>% untabyl(), data.frame(x = c(letters[1:4], "Total"), `0` = c("82.7% (417)", 
         "0.4%   (2)", "0.2%   (1)", "0.0%   (0)", "83.3% (420)"), `1` = c("16.5% (83)", 
         "0.0%  (0)", "0.0%  (0)", "0.2%  (1)", "16.7% (84)"), check.names = FALSE, stringsAsFactors = FALSE)) at testthat/test-adorn-ns.R:16
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: source_an %>% adorn_totals() %>% adorn_percentages("all") %>% adorn_pct_formatting() %>% 
         adorn_ns() %>% untabyl()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: function_list[[i]](value)
  11: adorn_totals(.)
  12: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", `0` = 420, 
         `1` = 84), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  13: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", 
         `0` = 420, `1` = 84), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame"
     )))
  14: xpdrows.data.frame(x, rows, new.rows)
  15: `[[<-`(`*tmp*`, i, value = c("a", "b", "c", "d", NA))
  16: `[[<-.data.frame`(`*tmp*`, i, value = c("a", "b", "c", "d", NA))
  17: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 19. Error: front parameter works (@test-adorn-ns.R#34)  ─────────────────────
  replacement has 5 rows, data has 4
  1: expect_equal(source_an %>% adorn_totals() %>% adorn_percentages("all") %>% adorn_pct_formatting() %>% 
         adorn_ns("front") %>% untabyl(), data.frame(x = c(letters[1:4], "Total"), `0` = c("417 (82.7%)", 
         "  2  (0.4%)", "  1  (0.2%)", "  0  (0.0%)", "420 (83.3%)"), `1` = c("83 (16.5%)", 
         " 0  (0.0%)", " 0  (0.0%)", " 1  (0.2%)", "84 (16.7%)"), check.names = FALSE, 
         stringsAsFactors = FALSE)) at testthat/test-adorn-ns.R:34
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: source_an %>% adorn_totals() %>% adorn_percentages("all") %>% adorn_pct_formatting() %>% 
         adorn_ns("front") %>% untabyl()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: function_list[[i]](value)
  11: adorn_totals(.)
  12: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", `0` = 420, 
         `1` = 84), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  13: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", 
         `0` = 420, `1` = 84), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame"
     )))
  14: xpdrows.data.frame(x, rows, new.rows)
  15: `[[<-`(`*tmp*`, i, value = c("a", "b", "c", "d", NA))
  16: `[[<-.data.frame`(`*tmp*`, i, value = c("a", "b", "c", "d", NA))
  17: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 20. Error: attributes make it through unaltered (@test-adorn-ns.R#78)  ──────
  replacement has 5 rows, data has 4
  1: expect_equal(attributes(source_an %>% adorn_totals() %>% adorn_percentages("all") %>% 
         adorn_pct_formatting() %>% adorn_ns("front")), attributes(source_an %>% adorn_totals() %>% 
         adorn_percentages("all") %>% adorn_pct_formatting())) at testthat/test-adorn-ns.R:78
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: source_an %>% adorn_totals() %>% adorn_percentages("all") %>% adorn_pct_formatting() %>% 
         adorn_ns("front")
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: function_list[[i]](value)
  11: adorn_totals(.)
  12: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", `0` = 420, 
         `1` = 84), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  13: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(x = "Total", 
         `0` = 420, `1` = 84), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame"
     )))
  14: xpdrows.data.frame(x, rows, new.rows)
  15: `[[<-`(`*tmp*`, i, value = c("a", "b", "c", "d", NA))
  16: `[[<-.data.frame`(`*tmp*`, i, value = c("a", "b", "c", "d", NA))
  17: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 21. Error: works with totals row (@test-adorn-pct-formatting.R#46)  ─────────
  replacement has 4 rows, data has 3
  1: expect_equal(dat %>% adorn_totals("row") %>% adorn_percentages("col") %>% untabyl(), 
         data.frame(Operation = c("Login", "Posted", "Deleted", "Total"), `Total Count` = c(5/70, 
             25/70, 40/70, 1), check.names = FALSE, stringsAsFactors = FALSE)) at testthat/test-adorn-pct-formatting.R:46
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: dat %>% adorn_totals("row") %>% adorn_percentages("col") %>% untabyl()
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: function_list[[i]](value)
  11: adorn_totals(., "row")
  12: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(Operation = "Total", `Total Count` = 70), row.names = c(NA, 
     -1L), class = c("tbl_df", "tbl", "data.frame")))
  13: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(Operation = "Total", 
         `Total Count` = 70), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame"
     )))
  14: xpdrows.data.frame(x, rows, new.rows)
  15: `[[<-`(`*tmp*`, i, value = c("Login", "Posted", "Deleted", NA))
  16: `[[<-.data.frame`(`*tmp*`, i, value = c("Login", "Posted", "Deleted", NA))
  17: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 22. Error: (unknown) (@test-adorn-percentages.R#44)  ────────────────────────
  replacement has 4 rows, data has 3
  1: source1 %>% adorn_totals(c("row", "col")) at testthat/test-adorn-percentages.R:44
  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_totals(., c("row", "col"))
  10: `[<-`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(cyl = "Total", `0` = 19, 
         `1` = 13), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame")))
  11: `[<-.data.frame`(`*tmp*`, (nrow(dat) + 1), , value = structure(list(cyl = "Total", 
         `0` = 19, `1` = 13), row.names = c(NA, -1L), class = c("tbl_df", "tbl", "data.frame"
     )))
  12: xpdrows.data.frame(x, rows, new.rows)
  13: `[[<-`(`*tmp*`, i, value = c(4, 6, 8, NA))
  14: `[[<-.data.frame`(`*tmp*`, i, value = c(4, 6, 8, NA))
  15: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 381 SKIPPED: 0 FAILED: 22
  1. Error: totals row is correct (@test-add-totals.R#18) 
  2. Error: totals row and col produce correct results when called together (@test-add-totals.R#49) 
  3. Error: order doesn't matter when row and col are called together (@test-add-totals.R#66) 
  4. Failure: both functions work with a single column (@test-add-totals.R#81) 
  5. Failure: both functions work with a single column (@test-add-totals.R#83) 
  6. Error: grouped_df gets ungrouped and succeeds (@test-add-totals.R#122) 
  7. Error: na.rm value works correctly (@test-add-totals.R#129) 
  8. Error: add_totals respects if input was data.frame (@test-add-totals.R#141) 
  9. Error: add_totals respects if input was data_frame (@test-add-totals.R#148) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted