Create a lens into a specific slice of a specific dimension of a multidimensional object. Not to be confused with dplyr slice.
slice_l(dimension, slice, drop = FALSE)
dimension | the dimension to slice |
---|---|
slice | the slice index |
drop | whether or not to drop dimensions with length 1. Only applies to view. |
(x <- matrix(1:4, ncol = 2))#> [,1] [,2] #> [1,] 1 3 #> [2,] 2 4#> [,1] [,2] #> [1,] 2 4#> [,1] #> [1,] 3 #> [2,] 4#> [,1] [,2] #> [1,] 10 20 #> [2,] 2 4