View source: R/small_helpers.R
| drop_type_vars | R Documentation |
If summarise_plus() is used with the nested options "all" or "single", three
variables are automatically generated: TYPE, TYPE_NR and DEPTH. With this functions
these variables are dropped.
drop_type_vars(data_frame)
data_frame |
The data frame with automatically generated variables. |
Returns a data frame without the variables TYPE, TYPE_NR and DEPTH.
# Example format
sex. <- discrete_format(
"Total" = 1:2,
"Male" = 1,
"Female" = 2)
# Example data frame
my_data <- dummy_data(1000)
# Call function
all_possible <- my_data |>
summarise_plus(class = c(year, sex),
values = c(income, probability),
statistics = c("sum", "mean", "freq"),
formats = list(sex = "sex."),
weight = weight,
nesting = "all",
na.rm = TRUE) |>
drop_type_vars()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.