Allows to get and set element names.
Replaces the older functions getElementNames
, getElementNames2
,
and eNames
which are deprecated.
Examples
# copy Boeker grid to x
x <- boeker
## get element names
e <- elements(x)
e
#> [1] "self" "ideal self" "mother"
#> [4] "father" "kurt" "karl"
#> [7] "george" "martin" "elizabeth"
#> [10] "therapist" "irene" "childhood self"
#> [13] "self before illness" "self with delusion" "self as dreamer"
## 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")