build_plot | R Documentation |
Adds a geom layer to a ggplot object based on user input.
build_plot(
data,
chart_geom = "Line Chart",
share = FALSE,
x_var = NULL,
y_var = "None",
color_var = "None",
facet_var = "None",
second_var = NULL,
legend = TRUE,
caption = TRUE,
labels_and_colors = NULL,
column_key = NULL,
format = FALSE,
ytextposition = FALSE,
reverse_color = FALSE,
alpha_var = NULL
)
data |
A tibble of formatted data for the ggplot |
chart_geom |
choose from Line Chart or Bar Chart; defaults to Line Chart |
share |
If TRUE, calculates the share |
x_var |
The name of fiscal year variable, as string |
y_var |
The name of variable to plot on y-axis |
color_var |
The name of the coloration variable, as string |
facet_var |
The name of facet variable, as string |
second_var |
The name of the secondary facet variable, as string |
legend |
If TRUE, includes a legend |
caption |
If TRUE, includes a source caption |
labels_and_colors |
A csis360 lookup data.frame with factor information |
column_key |
A csis360 lookup data.frame with column information |
format |
If TRUE, summarize the data.frame |
ytextposition |
If TRUE, add ytextposition to allow for geom_text overlays. |
reverse_color |
If TRUE, the order of the color variable is flipped |
Intended to handle ggplot settings that depend on user input. Settings that apply universally should be added in server.R.
A ggplot object including user-specified geom layer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.