
Set names for a LazyColumn
setNames-LazyColumn.RdAssigns names to the underlying data of a LazyColumn, returning a
new LazyColumn with the same scale and location as the original.
This enables name-based subsetting via [ on LazyColumn
objects, mirroring stats::setNames() for ordinary vectors.
Usage
# S4 method for class 'LazyColumn,character'
setNames(object = nm, nm)Examples
set.seed(123)
mat_a <- matrix(rnorm(500), nrow = 50, ncol = 10)
lazy_a <- LazyMatrix(mat_a, "sd", "mean")
lazy_c <- lazy_a[, 2]
lazy_named <- setNames(lazy_c[1:26], letters[1:26])
lazy_named["a"]
#> a
#> 0.2096104