R Markdown

Log Transformations are used to transform skewed datasets to nearly normal distributions by comparing log(x) against y.

How do I log transform a single vector?

To do a log transformation of a single vector, we just add 1 to the vector and use the log() function

logVector <- c(100, 40, 44, 21, 32, 8)
print(logVector)
## [1] 100  40  44  21  32   8
log(logVector + 1)
## [1] 4.615121 3.713572 3.806662 3.091042 3.496508 2.197225

Additional Readings

For more information on this topic, see https://rpubs.com/marvinlemos/log-transformation

Keywords

  • normal distribution
  • skewed
  • log()