| rename {ir} | R Documentation |
Rename columns in ir objects
Description
Rename columns in ir objects
Usage
rename.ir(.data, ...)
rename_with.ir(.data, .fn, .cols = dplyr::everything(), ...)
Arguments
.data |
An object of class |
... |
For For |
.fn |
A function used to transform the selected |
.cols |
< |
Value
.data with renamed columns. If the spectra column is renamed,
and no new valid spectra column is created, the ir class is dropped, else
the object is of class ir.
Source
See Also
Other tidyverse:
arrange.ir(),
distinct.ir(),
extract.ir(),
filter-joins,
filter.ir(),
group_by,
mutate-joins,
mutate,
nest,
pivot_longer.ir(),
pivot_wider.ir(),
rowwise.ir(),
select.ir(),
separate.ir(),
separate_rows.ir(),
slice,
summarize,
unite.ir()
Examples
## rename
dplyr::rename(ir_sample_data, hol = "holocellulose")
dplyr::rename(ir_sample_data, spec = "spectra") # drops ir class
## rename_with
dplyr::rename_with(ir_sample_data, .cols = dplyr::starts_with("id_"),
toupper)
dplyr::rename_with(ir_sample_data, toupper) # drops ir class