rank.normalize: Rank normalization

Description Usage Arguments Value Examples

View source: R/normalize.R

Description

This function fits the data exactly to the normal distribution (or any other quantile function given as FUN) using corresponding quantiles.

Usage

1
rank.normalize(x, FUN = qnorm, ties.method = "average", na.action)

Arguments

x

the data to normalize

FUN

a quantile function such as qnorm

ties.method

the ties.method argument for rank

na.action

a function to handle NAs. Defaults to the value of options("na.action")

Value

the normalized data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
not.normal <- rlnorm(100)
hist(not.normal)
hist(rank.normalize(not.normal))

# Different function
hist(rank.normalize(not.normal, FUN = qexp))

# Breaking ties
hist(rank.normalize(not.normal, ties.method = "random"))

# Missing values
not.normal[10] <- NA
hist(rank.normalize(not.normal)) # Shouldn't fail
## Not run: hist(rank.normalize(not.normal, na.action = na.fail)) # Should fail

xrobin/xavamess documentation built on May 13, 2018, 12:15 p.m.