Detect Log-transformed Data

Description

is_logscale tells if some numeric data is in log scale, e.g., normalized microarray data, using the same heuristic as GEO2R.

log_transform apply a log transformation to the data. Negative values get assigned the value NaN.

Usage

is_logscale(x)

log_transform(x, base = 2)

Arguments

x
a numeric data object (matrix, vector, ExpressionSet)
base
log base to use.

Details

The data needs to be of reasonable size and variance for the detection heuristic to work correctly.

Examples


x <- rmatrix(20, 10, dist=rnorm, mean=500)
is_logscale(x)
## [1] FALSE
is_logscale(log_transform(x))
## [1] TRUE