elements: Get or replace element names

Description Usage Arguments Examples

View source: R/repgrid-elements.r

Description

Allows to get and set element names. Replaces the older functions getElementNames, getElementNames2, and eNames which are deprecated.

Usage

1
2
3
elements(x)

elements(x, position) <- value

Arguments

x

A repgrid object.

value

Character vector of element names.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# copy Boeker grid to x
x <- boeker

## get element names
e <- elements(x)
e

## replace element names
elements(x) <- rev(e)       # reverse all element names
elements(x)[1] <- "Hannes"  # replace name of first element

# replace names of elements 1 and 3
elements(x)[c(1,3)] <- c("element 1", "element 3")   
 

markheckmann/OpenRepGrid documentation built on April 30, 2021, 2:33 a.m.