Experiment
library(mall)
options(.mall_chat = ellmer::chat_google_gemini())
## Using model = "gemini-2.5-flash".
library(tidyverse)
my_palette <- c("grey9", "violet", "darkgreen", "midnightblue",
"turquoise", "darkorange", "grey", "brown",
"darkred", "burlywood", "goldenrod2", "slateblue")
my_palette |>
tibble(pal_colors = _) |>
ggplot() +
aes(x = pal_colors, y = "all",
fill = I(pal_colors)) +
geom_tile()

'tribble(~item, ~times,
"kangaroo", 25,
"goldfish", 20,
"frog", 30,
"bear", 22) |>
llm_classify(col = item,
labels = my_palette,
pred_name = "color"
) |>
ggplot() +
aes(x = item, y = times) +
geom_col() +
aes(fill = I(color))' |>
ggram::ggram(code = _, title = "LLM assisted semantic color encoding using {mall}!🎨🎉", subtitle = "Colors selected with mall::llm_vec_classify() which translated \n from an animal to a specific color among 12 options in a pallet 👀🤯")
## [working] (0 + 0) -> 2 -> 2 | â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– 50%[working] (0 + 0) -> 1 -> 3 | â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– 75% ! There were 1 predictions with invalid output, they were coerced to NA
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_tile()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_text()`).
## Warning: Removed 10 rows containing missing values or values outside the scale range
## (`geom_hline()`).
