idx_add {volker}R Documentation

Calculate the mean value of multiple items

Description

[Experimental]

Usage

idx_add(data, cols, newcol = NULL, negative = FALSE, clean = TRUE)

Arguments

data

A dataframe.

cols

A tidy selection of item columns.

newcol

Name of the index as a character value. Set to NULL (default) to automatically build a name from the common column prefix, prefixed with "idx_".

negative

If FALSE (default), negative values are recoded as missing values.

clean

Prepare data by data_clean.

Value

The input tibble with an additional column that contains the index values. The column contains the result of the alpha calculation in the attribute named "psych.alpha".

Examples

ds <- volker::chatgpt
volker::idx_add(ds, starts_with("cg_adoption"))

[Package volker version 2.0.1 Index]