getIndex {refer} | R Documentation |
Functions to obtain or set the index to which a slice
object points.
getIndex(x)
setIndex(x, ...)
x |
object of class |
... |
objects compatible with extracting or replacing a vector |
object of class "slice"
x <- matrix(1:9, nrow=3)
slice_x <- slice(x, 2:3, 1)
identical(getIndex(slice_x), list(2:3, 1)) # TRUE
setIndex(slice_x, list(1, substitute()))
identical(!slice_x, c(1, 4, 7)) # TRUE