addAvgElement: Add a new average element

Description Usage Arguments Value Examples

View source: R/repgrid-basicops.r

Description

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

Usage

1
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

1
2
3
4
5
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 30, 2021, 2:33 a.m.