keys {listArray} | R Documentation |
Returns a list of indices as string, list or unique values (like dimnames
).
Description
Returns a list of indices as string, list or unique values (like dimnames
).
Usage
keys(x, type = "character")
Arguments
x |
listArray object |
type |
character: return the indices as string, list or unique values (default: |
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
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
[Package listArray version 0.1.1 Index]