reshape_l {lenses}R Documentation

Lens into a new dimension(s)

Description

Construct a lens that is a view of the data with a new set of dimensions. Both view and set check that the new dimensions match the number of elements of the data.

Usage

reshape_l(dims)

Arguments

dims

a vector with the new dimensions

Examples

x <- 1:9
view(x, reshape_l(c(3,3)))
set(x, reshape_l(c(3,3)) %.% diag_l, 100)

[Package lenses version 0.0.3 Index]