Learn R Programming

tinylens (version 0.1.0)

rows_l: Rows lens

Description

This function returns a lens that selects the specified rows.

Usage

rows_l(idx)

Value

A lens that selects the specified rows

Arguments

idx

The rows to select

Examples

Run this code
d <- data.frame(x = 1:10, y = 11:20, z = 21:30)
l <- rows_l(1:2)
# get the first two rows
view(d, l)
# set the first two rows
set(d, l, 1:2)

Run the code above in your browser using DataLab