The tb() method fails with an error when given the output of descr() from a grouped tibble where the grouping variable is named 'method' (or 'decreasing'). The same code works correctly for other variable names. See below code as a minimal example to reproduce:
dat <- tibble(method = c("new", "old"), outcome = c(1, 2))
# produces: Error in match.arg(method) : 'arg' must be of length 1
dat %>%
group_by(method) %>%
descr(outcome) %>%
tb()
# produces expected output
dat %>%
rename(not_method = method) %>%
group_by(not_method) %>%
descr(outcome) %>%
tb()
I think this can be fixed by putting unname() around the second argument to do.call(what = "order", ...) (in two places).
Hi,
The tb() method fails with an error when given the output of descr() from a grouped tibble where the grouping variable is named 'method' (or 'decreasing'). The same code works correctly for other variable names. See below code as a minimal example to reproduce:
I think this can be fixed by putting
unname()
around the second argument todo.call(what = "order", ...)
(in two places).Cheers,
Cam