Description Usage Arguments Value Examples
This function can be used to create a proper trans object that encapsulates a power transformation (x^n).
1 | power_trans(n)
|
n |
The degree of the power transformation |
A trans object
1 2 3 4 5 6 7 8 9 10 11 | # Power of 5 transformations
trans <- power_trans(2)
trans$transform(1:10)
# Cubic root transformation
trans <- power_trans(1/3)
trans$transform(1:10)
# Use it in a plot
ggplot() + geom_line(aes(x=1:10, y=1:10)) +
scale_x_continuous(trans = power_trans(2), expand=c(0,1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.