scale_all_variables: Function to standardize all variables based on supplied mean...

View source: R/missing_data_lm_functions.R

scale_all_variablesR Documentation

Function to standardize all variables based on supplied mean and sd vectors

Description

Function to standardize all variables based on supplied mean and sd vectors

Usage

scale_all_variables(data, mean, sd)

Arguments

data

The dataset

mean

Vector of means.

sd

Vector of standard deviations

Value

Returns a dataset where all of the variables have been scaled.

Examples

## Not run: 
x <- c(1,2,3,4,5)
y <- c(2.1,2.5,4,5,6)
temp_data <- as.data.frame(cbind(y, x))
scale_all_variables(data=temp_data, mean=sapply(temp_data, mean), sd=sapply(temp_data, sd))

## End(Not run)

jbiesanz/fabs documentation built on July 15, 2022, 11:02 p.m.