standardize: Mean-centers each variable in a block of data and then scale...

Description Usage Arguments Value

View source: R/local_preprocessing_functions.R

Description

Mean-centers each variable in a block of data and then scale each variable to unit variance

Usage

1
2
3
4
standardize(
  input_data,
  settings = list(column_means = NULL, column_stds = NULL)
)

Arguments

input_data

A matrix containing data. The rows indicate the samples, the columns indicate the variables.

settings

A list with a two named elements "column_stds" and "column_means". When "column_stds" is set, the supplied vector is used for scaling, otherwise it is calculated. When "column_means" is set, the supplied vector is used for mean substraction. Both vectors should have a length equal to the number of variables. All named elements can be set, and optionally left out, seperately.

Value

A named list with "preprocessed_data": the scaled input_data matrix, and "settings", which is equal to the settings input parameter when set, and otherwise contains the calculated and used column_stds and column_means.


GeertPostma/pathmodelr documentation built on Oct. 5, 2021, 4:17 p.m.