keys: Returns a list of indices as string, list or unique values...

Description Usage Arguments Value Examples

View source: R/keys.R

Description

Returns a list of indices as string, list or unique values (like dimnames).

Usage

1
keys(x, type = "character")

Arguments

x

listArray object

type

character: return the indices as string, list or unique values (default: character)

Value

Returns the indices as string, list or unique indices. If type is

type="character"

a character vector with the retranslated indices

type="list"

as list of lists with the retranslated indices

type="names"

as list of lists with the retranslated unique(!) indices like dimnames

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
l <- listArray(matrix(1:9, 3, 3))
k <- keys(l)
k
# access object in listArray
pos <- which(k=='3, 2')
l[[pos]]
#
l["test"] <- "test"
keys(l, 'c') # as keys(l)
keys(l, 'l')
keys(l, 'n')
# Note that l['test'][3] will deliver NULL since the entry does not exist

listArray documentation built on Sept. 13, 2020, 5:19 p.m.