normalize_vector: Normalize a vector

Description Usage Arguments Value Author(s) Examples

View source: R/normalize_vector.R

Description

Normalize a vector by subtracting its mean from all the elements and dividing by its SD

Usage

1
normalize_vector(Vector, withSD = TRUE)

Arguments

Vector

A vector of numerical values

withSD

A Boolean indicating if divide by SD when normalizing. Defaults to TRUE

Value

Returns a vector of same length, with normalized values

Author(s)

Subhrangshu Nandi, PhD Statistics, UW Madison; snandi@wisc.edu or nands31@gmail.com

Examples

1
2
vector <- c( 2, 3, 5, 2, 1 )
normalize_vector( vector, TRUE )

snandi/RFunctionsSN documentation built on May 30, 2019, 5:04 a.m.