slice: Take a slice of an array selecting indices along a margin

View source: R/pr.R

sliceR Documentation

Take a slice of an array selecting indices along a margin

Description

Performs the same role as selecting with subscripts except that this is easier to use when dimension of the array is not known. Its application is limited, however, to selecting single slices along a single dimension.

Usage

slice(a, MARGIN, ind)

Arguments

a

an array

MARGIN

a single dimension along which to select a slice (i.e. a section)

ind

the level at which to select the slice. If ind is out of range, slice returns NAs with the correct structure

Examples

Titanic
slice(Titanic, 1, 1)  
slice(slice(Titanic, 1, 1), 1, 2)  

gmonette/gnew documentation built on July 9, 2022, 12:57 p.m.