getIndex {refer}R Documentation

Extract or Set Slice Index

Description

Functions to obtain or set the index to which a slice object points.

Usage

getIndex(x)

setIndex(x, ...)

Arguments

x

object of class "slice"

...

objects compatible with extracting or replacing a vector

Value

object of class "slice"

Examples

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


[Package refer version 0.1.0 Index]