Learn R Programming

lenses (version 0.0.3)

index_l: Construct a lens into an index/name

Description

This is the lens version of [[

Usage

index_l(el)

index(el)

Arguments

el

The element the lens should point to can be an integer or name.

Functions

  • index: shorthand

Examples

Run this code
# NOT RUN {
x <- 1:10
view(x, index_l(1))
set(x, index(5), 50)
head(view(iris, index(2)))
# }

Run the code above in your browser using DataLab