Create a lens into a set of rows

rows_l(rows, drop = FALSE)

Arguments

rows

the rows to focus on

drop

whether or not to drop dimensions with length 1

Examples

x <- matrix(1:4, ncol = 2) rownames(x) <- c("first", "second") x
#> [,1] [,2] #> first 1 3 #> second 2 4
view(x, rows_l(1))
#> [,1] [,2] #> first 1 3
view(x, rows_l("second"))
#> [,1] [,2] #> second 2 4
set(x, rows_l(1), c(20,40))
#> [,1] [,2] #> first 20 40 #> second 2 4