Learn R Programming

arrayhelpers (version 0.76-20120816)

slice: alternative to index an array

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

slice(a, ..., drop = TRUE)

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

  • array

Examples

Run this code
slice (arrayhelpers:::a, j = 3 : 2)

Run the code above in your browser using DataLab