
Subset a LazyMatrix by columns
subset-LazyMatrix.RdSubsets a LazyMatrix object by columns, returning either a
LazyColumn or a new LazyMatrix depending on the number
of columns selected. Row subsetting is not yet supported.
Value
A LazyColumn if a single column is selected, or a
LazyMatrix if multiple columns are selected.
Examples
A <- Matrix::sparseMatrix(i = c(1,2,3), j = c(1,2,3), x = c(1,2,3))
lazy_m <- LazyMatrix(A, "sd", "mean")
# Single column → LazyColumn
lazy_col <- lazy_m[, 2]
# Multiple columns → LazyMatrix
lazy_subset <- lazy_m[, 1:3]