df_standardize: Standardize data.frame

View source: R/data_frame_functions.R

df_standardizeR Documentation

Standardize data.frame

Description

Standardize all variables in a data.frame. Can use weighted standardization. Wraps standardize.

Usage

df_standardize(
  df,
  exclude = NULL,
  messages = T,
  exclude_logicals = T,
  exclude_range_01 = T,
  w = NULL
)

Arguments

df

(data frame) The data frame.

exclude

(chr vector) Names of variables to not standardize.

messages

(lgl scalar) Whether to output messages.

exclude_logicals

Exclude boolean/logical variables

exclude_range_01

Exclude variables that range between 0 and 1

w

(num vector) Weights to use, if any.

Value

Returns a standardized data.frame, i.e. one where every variable has mean 0 and sd 1.

Examples

head(iris) #not standardized
head(df_standardize(iris)) #standardized

Deleetdk/kirkegaard documentation built on May 8, 2024, 12:27 a.m.