standardize: standardize

View source: R/standardize.R

standardizeR Documentation

standardize

Description

Function computes the z-scores for numeric columns of a dataframe.

Scores are computed by dividing the raw differences from the the mean by a multiple of the standard deviation.

Usage

standardize(df = NULL, cols = NULL, mul = 1, do_na = TRUE)

Arguments

df

A data frame with numeric columns to be standardized

cols

A character vector of column names from df that are to be standardized.

mul

An integer (typically 1 or 2) that multiplies the standard deviation as the divisor for the z-score.

do_na

A logical which if TRUE removes NA values in computing the mean and standard deviation.

Value

Returns a data.table with the numeric columns standardized into z-scores.


deandevl/RregressPkg documentation built on June 12, 2025, 5:29 p.m.