addAvgElement: Add a new average element

View source: R/repgrid-basicops.r

addAvgElementR Documentation

Add a new average element

Description

A new element is added to the grid. The scores are the arithmetic means across all selected elements.

Usage

addAvgElement(x, name = "avg", i, digits = Inf)

Arguments

x

A repgrid object.

name

Name of new element.

i

Indexes of elements to be averaged across. Negative indexes can be used to exclude elements from the complete set. Duplicate indexes are allowed but a warning is issued.

digits

Digits to round mean value to. By default no rounding is used (digits = Inf). Use digits = 0 to round to nearest integer, i.e. only using original integer rating scores.

Value

A repgrid object with additional new element.

Examples

addAvgElement(feixas2004, "others", i = 2:12)
addAvgElement(feixas2004, "others", i = 2:12, digits = 0) # integers

# exluding elements via negative indexes
addAvgElement(feixas2004, "others", i = c(-1, -13))


markheckmann/OpenRepGrid documentation built on April 14, 2024, 8:15 a.m.