Learn R Programming

heatmaply (version 0.7.1)

percentize: Empirical Percentile Transformation

Description

An Empirical Percentile Transformation (percentize) is similar to taking the rank of a variable. The difference is that it is simpler to compare and interpret the transformed variables.

This is helpful for comparing several variables in a heatmap (e.g.: heatmaply).

Usage

percentize(x, ...)

Arguments

x
a vector or a data.frame.
...
Currently ignored.

Value

A vector (or data.frame) after ecdf was used on that vector. If x is a data.frame then only the numeric variables are transformed.

Examples

Run this code
## Not run: 
# x <- mtcars
# x <- data.frame(x)
# x$am <- factor(x$am)
# x$vs <- factor(x$vs)
# heatmaply(percentize(x))
# 
# 
# x <- data.frame(a = 1:10, b = 11:20)
# x[4:6, 1:2] <- NA
# percentize(x)
# percentize(x[,1])
# 
# ## End(Not run)

Run the code above in your browser using DataLab