You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful if tabyl() accepted a character vector of column names as the variables to be summarised, similar to many tidyselect() functions.
An example of how I imagine the code would work:
library("tidyverse")
library("janitor")
# Sample data
mydat <- tibble(x=c(1:4),y=c(5:8),z=c(11:14))
# Define vectors
vec1 <- c("x")
vec2 <- c("x","y")
vec3 <- c("x","y","z")
# All these lines produce the same output, equivalent to mydat %>% tabyl(x)
mydat %>% tabyl(all_of(vec1))
mydat %>% tabyl(all_of(vec2))
mydat %>% tabyl(all_of(vec3))
Currently tabyl only accepts the first element of the character vector as a parameter, so the tables are always one-way. Allowing the vector to be fed in with either 1, 2 or 3 arguments would allow a more flexible workflow, e.g. in custom functions integrating tabyl.
The text was updated successfully, but these errors were encountered:
Feature requests
It would be useful if
tabyl()
accepted a character vector of column names as the variables to be summarised, similar to manytidyselect()
functions.An example of how I imagine the code would work:
Currently
tabyl
only accepts the first element of the character vector as a parameter, so the tables are always one-way. Allowing the vector to be fed in with either 1, 2 or 3 arguments would allow a more flexible workflow, e.g. in custom functions integratingtabyl
.The text was updated successfully, but these errors were encountered: