View source: R/plot_functions.R
create_plot_with_config | R Documentation |
Create Plot With Config This function calls a ploting function using a config, and a tibble
create_plot_with_config(data, config, plot_func, ...)
data |
A tibble |
config |
A named list. The list must have the fields "plot" and tooltips". The "plot" field must be named list of the arguemnts of the plot_func. The "tooltips" field must be a list of strings that are either names of columns in the data, or names of aesthetics in the plot_func |
plot_func |
A string that is the name of a plot function |
... |
Arguments to plotly::ggplotly |
data <- dplyr::tibble( "Study Leads" = c("s1", "s2", "s3"), "Resource Type" = c("r1", "r2", "r3"), "Year" = c(2000L, 2001L, 2002L), "Month" = factor("Jul", "Jul", "Jun"), "Count" = c(10, 30, 40) ) config <- list( "plot" = list( "x" = "Study Leads", "y" = "Count", "fill" = "Resource Type", "facet" = list("Year", "Month") ), "tooltips" = list("count", "fill") ) create_plot_with_config( data, config, "create_file_upload_timeline_plot" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.