View source: R/summarise_strat_var.R
summarise_strat_var | R Documentation |
Sum a Stratified Variable
summarise_strat_var(df, vars, strat = NULL, new_var = "sum")
df |
A dataframe of model output. |
vars |
A character vector containing the unstratified variables to summarise |
strat |
The number of stratifications present in the data set |
new_var |
The name of the summarised variable |
Returns the original dataframe with an additional summarised variable
summarise_var_by_strat
df <- dplyr::mutate(iris, Petal.Length1 = Petal.Length, Petal.Length2 = Petal.Length) df <- tibble::as_tibble(df) summarise_strat_var(df, vars = c("Petal.Length"), strat = 2, new_var = "sum")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.