compose | R Documentation |
This function integrates a range of specified variables into a simple composite measure by computing the mean for each observation. By default, the respective variables are standardized in advance.
compose(data, .cols, .composite = "composite", .scale = TRUE)
data |
A data frame. |
.cols |
< |
.composite |
The name of the new column for the composite measure. If no name is supplied, the new composite measure will be named "composite". |
.scale |
A logical indicating whether columns should be scaled in advance (i.e., by means of z standardization). The default is TRUE. |
An tibble containing the new composite measure named as specified in
.composite
.
compose(data = studach, .cols = math:read, .composite = "achievement")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.