rename.hyperSpec.Rd
rename extra data columns of hyperSpec objects.
Special column $spc
contains the spectra matrix.
Unlike dplyr::select() dplyr::rename() keeps all the variables of the data frame intact.
However, if $spc
is renamed, the result is an error instead of a hyperSpec object.
# S3 method for hyperSpec
rename(.data, ...)
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). See Methods, below, for more details.
For rename()
: <tidy-select
> Use
new_name = old_name
to rename selected variables.
For rename_with()
: additional arguments passed onto .fn
.
hyperSpec object. If $spc
is renamed, the result is an error.
laser %>%
rename(filename2 = filename) %>%
head() # results in a hyperSpec object
#> hyperSpec object
#> 6 spectra
#> 3 data columns
#> 36 data points / spectrum