normalize: Normalize a numeric vector

Description Usage Arguments Value Examples

View source: R/normalize.R

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)

paulponcet/bazar documentation built on July 15, 2019, 5:28 a.m.