| summarise_strat_var {idmodelr} | R Documentation | 
Sum a Stratified Variable
Description
Sum a Stratified Variable
Usage
summarise_strat_var(df, vars, strat = NULL, new_var = "sum")
Arguments
| 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 | 
Value
Returns the original dataframe with an additional summarised variable
See Also
summarise_var_by_strat
Examples
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")
[Package idmodelr version 0.4.0 Index]