Description Usage Arguments Details Examples
Turn a formula into a symbol
1 |
x |
a formula that would be passed to plotly functions. #' |
Turn a formula object (as used in plotly
functions for column names)
into a symbol object (as used in dplyr
functions for column names).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Useful for converting between plotly code and dplyr code
data <- data.frame(
group = "A"
x = 1:100,
y = rnorm(100)
)
x_plot <- ~x
y_plot <- ~y
plotly::plot_ly(
data,
x = x_plot,
y = y_plot
)
x_dplyr <- formula_to_sym(x_plot)
y_dplyr <- formula_to_sym(y_plot)
select(data, {{ x_dplyr }}, {{ y_dplyr }})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.