take_l: Construct a lens into a prefix of a vector

Description Usage Arguments Examples

Description

This constructs a lens into the first n elements of an object or the if negative indexing is used, as many as length(x) - n.

Usage

1
take_l(n)

Arguments

n

number of elements to take, or if negative the number of elements at the end to not take.

Examples

1
2
3
4
5
x <- 1:10
view(x, take_l(3))
view(x, take_l(-7))
set(x, take_l(2), c(100,200))
set(x, take_l(-8), c(100,200))

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