score_items | R Documentation |
Calculates summary scores of survey items into a vector. Targeted survey item names within a data frame must be named with a common string for filtering (e.g. "extraversion_1", "extraversion_2"). These common strings can be anywhere within the name.
score_items(df, selector, func = "sum", selector_position = "contains")
df |
data frame input |
selector |
text string to select column names |
func |
function to apply to data (default is 'sum') |
selector_position |
dictates which string selecting function to use for column names. Must be either "containts", "starts_with", "ends_with". |
Robert S. Chavez
score_items(mtcars, "ar", func = "mean")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.