Learn R Programming

MoTBFs (version 2.0)

rescale_data: Scale data

Description

Standardize the numeric columns of a data.frame.

Usage

rescale_data(data, v_mean = NULL, v_sd = NULL)

Value

A data.frame with scaled data. Non-numeric columns are also returned in their original position.

Arguments

data

data.frame containing the variables to be standardized.

v_mean

vector of means of the data.frame. The value for the non-numeric columns should be NA. If not given, it is computed from data.

v_sd

vector of standard deviations of the data.frame. The value for the non-numeric columns should be NA. If not given, it is computed from data.