slice_l: Slice lens

Description Usage Arguments Examples

Description

Create a lens into a specific slice of a specific dimension of a multidimensional object. Not to be confused with dplyr slice.

Usage

1
slice_l(dimension, slice, drop = FALSE)

Arguments

dimension

the dimension to slice

slice

the slice index

drop

whether or not to drop dimensions with length 1. Only applies to view.

Examples

1
2
3
4
(x <- matrix(1:4, ncol = 2))
view(x, slice_l(1, 2)) # x[2,, drop = FALSE]
view(x, slice_l(2, 2)) # x[,2, drop = FALSE]
set(x, slice_l(1,1), c(10,20))

cfhammill/fresnel documentation built on May 15, 2019, 1:13 p.m.