normalize: Normalize a numeric vector

Description Usage Arguments Value Examples

Description

This function divides x by the result of fun(x).

Usage

1
normalize(x, fun = "max", na.rm = TRUE, ...)

Arguments

x

numeric. A vector.

fun

character or function. Should own an na.rm argument. fun(x) should return either one unique value, or a numeric vector of the same length as x.

na.rm

Should missing values be removed in the calculation of fun(x)?

...

Additional arguments to be passed to fun.

Value

A numeric vector of the same length as x.

Examples

1
2
x <- rnorm(10)
normalize(x)

bazar documentation built on May 2, 2019, 7:02 a.m.