Create a lens into a set of columns
cols_l(cols, drop = FALSE)
cols | the columns to focus on |
---|---|
drop | whether or not to drop dimensions with length 1 |
x <- matrix(1:4, ncol = 2) colnames(x) <- c("first", "second") x#> first second #> [1,] 1 3 #> [2,] 2 4#> first #> [1,] 1 #> [2,] 2#> second #> [1,] 3 #> [2,] 4#> first second #> [1,] 20 3 #> [2,] 40 4