normalize {bazar}R Documentation

Normalize a numeric vector

Description

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

Usage

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

x <- rnorm(10)
normalize(x)


[Package bazar version 1.0.11 Index]