get_val {sparta} | R Documentation |
Get value or cell name
Description
Find the value or the name of a cell
Usage
get_val(x, y)
## S3 method for class 'sparta'
get_val(x, y)
get_cell_name(x, y)
## S3 method for class 'sparta'
get_cell_name(x, y)
Arguments
x |
sparta |
y |
named character vector or vector of cell indices |
Examples
x <- array(
c(1,0,0,2,3,4,0,0),
dim = c(2,2,2),
dimnames = list(
a = c("a1", "a2"),
b = c("b1", "b2"),
c = c("c1", "c2")
)
)
sx <- as_sparta(x)
get_val(sx, c(a = "a2", b = "b1", c = "c2"))
get_cell_name(sx, sx[, 4])
[Package sparta version 0.8.4 Index]