Learn R Programming

s2dverification (version 2.4.0)

SelIndices: Slices A Matrix Along A Dimension

Description

This function allows to select a subensemble from a matrix of any dimensions, providing the dimension along which the user aims at cutting the input matrix and between which indices.

Usage

SelIndices(var, posdim, limits)

Arguments

Value

The sliced matrix.

Examples

Run this code
a <- array(rnorm(24), dim = c(2, 3, 4, 1))
print(a)
print(a[, , 2:3, ])
print(dim(a[, , 2:3, ]))
print(SelIndices(a, 3, c(2, 3)))
print(dim(SelIndices(a, 3, c(2, 3))))

Run the code above in your browser using DataLab