Learn R Programming

gooseR (version 0.1.0)

goose_optimize_plot: Optimize ggplot2 Code with AI

Description

Get AI suggestions to improve a ggplot2 visualization.

Usage

goose_optimize_plot(
  plot_code,
  goals = c("aesthetics", "clarity", "accessibility"),
  data_sample = NULL
)

Value

List with optimized code and suggestions

Arguments

plot_code

Character string or expression with ggplot2 code

goals

Character vector of optimization goals

data_sample

Optional sample of the data being plotted

Examples

Run this code
if (FALSE) {
plot_code <- "
ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point()
"

optimized <- goose_optimize_plot(plot_code, 
                                 goals = c("aesthetics", "clarity"))
}

Run the code above in your browser using DataLab