standardize: Standardize numeric vector

Description Usage Arguments Value Examples

View source: R/standardize.R

Description

Function standardizes numeric vector using multiple methods

Usage

1
standardize(x, method = "zs", na.rm = FALSE)

Arguments

x

Numeric vector

method

Character string. Default is 'zs' (for z-score method). Other options include '01' (0 to 1 scaling) and 'pr' (percent rank)

na.rm

Should NAs be removed? Default is FALSE

Value

Numeric vector with standardized values

Examples

1
2
3
4
x <- c(1, 4, 5, 6, 2, 4, 10, 12, 5)
standardize(x)
standardize(x, method = "01")
standardize(x, method = "pr")

mladenjovanovic/bmbstats documentation built on Aug. 5, 2020, 4:20 p.m.