if (FALSE) {
# Example 1: SensoMineR chocolates (requires SensoMineR)
if (requireNamespace("SensoMineR", quietly = TRUE)) {
# Load data from SensoMineR
data("chocolates", package = "SensoMineR")
# ANOVA summary with Product and Panelist
res <- FactoMineR::AovSum(Granular ~ Product * Panelist, data = sensochoc)
intro <- "Six chocolates have been evaluated by a sensory panel,
during two days, according to a sensory attribute: granular.
The panel has been trained according to this attribute
and panellists should be reproducible when rating this attribute."
intro <- gsub("\n", " ", intro)
intro <- gsub("\\s+", " ", intro)
cat(intro)
prompt <- trainer_AovSum(res, audience = "beginner",
t_test = c("Product", "Panelist"),
introduction = intro)
cat(prompt)
res <- gemini_generate(prompt, compile_to = "html")
}
# Example 2: Poussin dataset (shipped with this package)
data(poussin)
intro <- "For incubation, 45 chicken eggs were randomly assigned to three batches of 15.
Three treatments (different incubation temperatures) were then applied to the batches.
We assume that after hatching, all chicks were raised under identical conditions
and then weighed at a standard reference age.
At that time, the sex of the chicks - a factor known beforehand to cause
significant weight differences - could also be observed.
The objective is to choose the treatment that maximizes chick weight."
intro <- gsub("\n", " ", intro)
intro <- gsub("\\s+", " ", intro)
cat(intro)
res <- FactoMineR::AovSum(Weight ~ Gender * Temperature, data = poussin)
prompt <- trainer_AovSum(res,
audience = "beginner",
t_test = c("Gender", "Temperature"),
introduction = intro)
cat(prompt)
res <- gemini_generate(prompt, compile_to = "html")
}
Run the code above in your browser using DataLab