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
.
is_logscale(x) log_transform(x, base = 2)
The data needs to be of reasonable size and variance for the detection heuristic to work correctly.
x <- rmatrix(20, 10, dist=rnorm, mean=500)
is_logscale(x)
## [1] FALSE
is_logscale(log_transform(x))
## [1] TRUE