score_items: Survey Item Scorer

View source: R/score_items.R

score_itemsR Documentation

Survey Item Scorer

Description

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.

Usage

score_items(df, selector, func = "sum", selector_position = "contains")

Arguments

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".

Author(s)

Robert S. Chavez

Examples

score_items(mtcars, "ar", func = "mean")

chavezlab/csnl documentation built on June 12, 2022, 10:09 a.m.