Intro Thoughts
Status Quo
library(tidyverse)
Experiment
library(mall)
options(.mall_chat = ellmer::chat_google_gemini())
## Using model = "gemini-2.5-flash".
emoji_palette <- str_split_1("🥵🔥❄️🥶🐻","")
temp <- c("30C", "88F", "20F")
emoji_for_temps <- temp |>
llm_vec_classify(emoji_palette)
## [working] (0 + 0) -> 2 -> 1 | ■■■■■■■■■■■ 33%[working] (0 + 0) -> 1 -> 2 |
## ■■■■■■■■■■■■■■■■■■■■■ 67%
emoji_for_temps
## [1] "🥵" "🥵" "🥶"
emoji_for_temps
## [1] "🥵" "🥵" "🥶"
ggplot() +
aes(x = temp,
y = c(86, 88, 20), # to Fahrenheit
label = emoji_for_temps) +
labs(y = "Temp in Fahrenheit",
x = "Different ways to talk temperature") +
geom_col() +
geom_text(size = 12)

palette()
## [1] "black" "#DF536B" "#61D04F" "#2297E6" "#28E2E5" "#CD0BBC" "#F5C710"
## [8] "gray62"
animals <- c("elephant", "turtle", "goldfish")
colors_for_animals <- animals |>
llm_vec_classify(palette())
colors_for_animals
## [1] "gray62" "#61D04F" "#F5C710"
ggplot() +
aes(x = animals,
y = c(1,2,3),
fill = colors_for_animals |> I()) +
geom_col() +
theme_gray(base_size = 15) +
labs(x = NULL)
