get_var_info | R Documentation |
Mostly a helper function for other tidy_table_one functions. The function takes a data frame or tibble and returns a descriptive tibble with the variable names, class, binary type (categorical or continuous), and the factor levels.
get_var_info(data, .vars = NULL)
data |
A data.frame or tbl_df |
.vars |
A character string of variable/column names. If empty, all columns are used |
A tbl_df with colums for
name of the variable/column
factor level if applicable, character levels too
variable class
variable type: categorical or continuous
library(dplyr)
library(ggplot2)
lapply(diamonds, class)
get_var_info(data = diamonds,
.vars = c("carat",
"cut",
"color",
"clarity",
"depth",
"table",
"price")) %>%
print(n = Inf)
get_var_info(data = pbc_mayo)
get_var_info(data = pbc_mayo,
.vars = c("status", "sex", "stage", "age"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.