standardize: Standardize a vector or columns in a dataframe by converting...

View source: R/standardize.R

standardizeR Documentation

Standardize a vector or columns in a dataframe by converting to z-scores

Description

Function to standardize a vector or columns in a dataframe by converting to z-scores.

Usage

standardize(x, cols = NULL, factors = NULL, idxCols = NULL, verbose = FALSE)

Arguments

x
  • vector or dataframe to standardize

cols
  • vector of column names to standardize (if x is a dataframe)

factors
  • vector of column names used as factors to standardize by (if x is a dataframe), or NULL

idxCols
  • vector of column names used as indices for standardized values, or NULL

verbose
  • flag (T/F) to print diagnostic information

Details

idxCols are just copied over from the relevant section of each combination of factor levels.

Value

standardized vector as z-scores (same size as x), or dataframe


wStockhausen/wtsUtilities documentation built on March 16, 2024, 10:38 a.m.