Skip to contents

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).

Usage

rescale_data(data, nirs_columns = list(), rescale_range = c(0, 100))

Arguments

data

A dataframe.

nirs_columns

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_columns = list() can be used to group data columns to preserve relative scaling. channels grouped together in a vector will preserve relative scaling across channels. Should match column names in the dataframe exactly.

nirs_columns = list("A", "B", "C")

will rescale each column separately. Relative scaling will be lost between data channels.

nirs_columns = list(c("A", "B", "C"))

will rescale all columns together. Relative scaling is preserved across the group of data channels.

nirs_columns = list(c("A", "B"), c("C", "D"))

will rescale columns A and B together, and columns C and D together. Relative scaling is preserved within each group, but not across groups of data channels.