View source: R/normalizations.R
| logXform | R Documentation |
This function imputes minimum values per the recommendations of Osborne (2002) and subsequently transforms the data to a base-10 logarithmic scale.
logXform(sample)
sample |
Nonempty finite numeric vector, matrix, array, or data frame without missing values. |
Computes log10((sample - min(sample)) + 1), including when all values are already positive. Centering precedes the unit offset to retain the minimum-1 anchor at large locations. Opposite-sign extremes use equivalent scaled arithmetic to avoid intermediate overflow.
Input must be nonempty and finite, with no NA or NaN. Numeric vectors, matrices, arrays and data frames are accepted; dimensions and names are retained. Anchoring uses the minimum over the whole input. Constants return zero. Rita() performs its own complete-case cleaning before calling transformations.
The log-transformed data, retaining input dimensions and names
Osborne, J. W. (2002). Notes on the use of data transformations. Practical Assessment, Research and Evaluation, 9(1), 42-50.
Osborne, J. W. (2002). The Effects of Minimum Values on Data Transformations. Retrieved from https://files.eric.ed.gov/fulltext/ED463313.pdf
values <- rnorm(100)
x <- logXform(values)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.