horvath_age | R Documentation |
Transform age in years using the log transformation defined in Horvath (2013). This function can also be used to convert transformed ages back to the original scale.
horvath_age(x, adult_age = 20, inverse = FALSE)
x |
numeric vector of ages |
adult_age |
Age of the adult of the species. From the original manuscript, 20 for humans and 15 for chimpanzees. |
inverse |
If TRUE, return transformed ages to the original scale |
transformed ages
age <- 0:100
transformed <- horvath_age(age)
plot(age, transformed, xlab="Age", ylab="Transformed Age", type="l")
# Conversion back to original scale
all.equal(age, horvath_age(transformed, inverse = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.