View source: R/add_text_column.R
get_trans | R Documentation |
Converts a character string specifying a transformation into a trans
object,
or returns the input if it is already a trans
object. Supports various
root, log, and other transformations.
get_trans(trans)
trans |
character or trans object. If class is character, it is converted to a trans object. Adds "root_cube", "root_fourth", "root_fifth" and "asinh" transformations, as well as "sqrt" transformation that allows plotting of lines at zero. If class is a trans object, it is returned as is. |
A trans
object corresponding to the specified transformation.
x_vec <- seq(1, 5, length.out = 1000)
y_vec <- get_trans("root_fifth")$transform(x_vec)
plot_tbl <- data.frame(x = x_vec, y = y_vec)
library(ggplot2)
ggplot(plot_tbl, aes(x, y)) +
geom_line() +
geom_point() +
coord_equal() +
expand_limits(x = 5, y = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.