View source: R/create_composite.R
create_composite | R Documentation |
This function will take as input a dataset, a selection of columns, and a name for the column to be created
create_composite(data, selection, name, na.rm = T)
data |
The data to add a composite column to |
selection |
A tidy selection of the variables that are to be averaged together |
name |
The name of the variable to be created |
na.rm |
Set to TRUE (default), will adjust the denominator in the case of missing data. If set to false, will return NA if the row has any missing data |
a tibble object
mtcars |> create_composite(c(drat, gear), drat_gear_average)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.