Learn R Programming

lenses (version 0.0.3)

reshape_l: 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

Run this code
# NOT RUN {
x <- 1:9
view(x, reshape_l(c(3,3)))
set(x, reshape_l(c(3,3)) %.% diag_l, 100)
# }

Run the code above in your browser using DataLab