view {tinylens}R Documentation

View the focused part of a data structure

Description

view() applies a lens to a data structure and returns the focused part.

set() applies a lens to a data structure and sets the focused part.

over() applies a lens to a data structure and modifies the focused part using a function.

Usage

view(d, l)

Arguments

d

The data structure to view

l

The lens to apply

Value

The part of the data structure focused by the lens

Examples

x <- 1:10
names(x) <- letters[1:10]
view(x, names_l)
set(x, names_l, LETTERS[1:10])
over(x, names_l, toupper)

[Package tinylens version 0.1.0 Index]