slice: alternative to index an array

Description Usage Arguments Value Author(s) Examples

Description

slice is an alternative interface to [ (extract). Dimensions to index must be given by name, i for the first, j for the second and so on.

Usage

1
2
3
slice(a, ..., drop = TRUE)

slice (a, ...) <- value

Arguments

a

vector, matrix, or array

...

indexing instructions. The names of the arguments specify the dimension (i = 1st, j = 2nd, ...). The indexing expressions are the same as for [

drop

see [

value

the values to assign

Value

array

Author(s)

Claudia Beleites

Examples

1
2
3
4
slice (arrayhelpers:::a, j = 3 : 2)
tmp <- arrayhelpers:::a
slice (tmp, j = 2 : 3) <- 0
tmp

arrayhelpers documentation built on Feb. 4, 2020, 5:06 p.m.