goose_optimize_plot: Optimize ggplot2 Code with AI

View source: R/ai_assistant.R

goose_optimize_plotR Documentation

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
)

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

Value

List with optimized code and suggestions

Examples

## Not run: 
plot_code <- "
ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point()
"

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

## End(Not run)

gooseR documentation built on Feb. 6, 2026, 5:07 p.m.