Resize the range (min and max values) of data channels to a new dynamic range,
while preserving the relative scaling across channels. e.g. rescale the range
of data to c(0,100)
.
Arguments
- data
A dataframe.
- nirs_channels
A
list()
of character vectors indicating the column names for data channels to be rescaled (see Details).- rescale_range
A numeric vector in the form
c(min, max)
, indicating the range of output values to which data channels will be rescaled.
Value
A tibble of class mnirs.data
with
metadata available with attributes()
.
Details
nirs_channels = list()
can be used to group data channels to preserve
relative scaling. channels grouped together in a vector will preserve
relative scaling across those channels. Should match column names in the
dataframe exactly.
nirs_channels = list("A", "B", "C")
will rescale each channel separately. Relative scaling will be lost between data channels.
nirs_channels = list(c("A", "B", "C"))
will rescale all channels together. Relative scaling is preserved across the group of data channels.
nirs_channels = list(c("A", "B"), c("C", "D"))
will rescale channels
A
andB
together, and channelsC
andD
together. Relative scaling is preserved within each group, but not across groups of data channels.