These functions use the active LLM to assist with data analysis and R code tasks. Each call uses an isolated chat context. Generated code is returned as a character string for the user to review and run manually.
llm_analyse() suggests analyses or answers a question about a dataset.
llm_code() generates R code for a described task.
llm_explain() explains R code in Dutch.
llm_suggest_plot() suggests a plot2() call for a dataset.
A data frame. Summarised before sending to the LLM; raw rows are never sent verbatim.
A specific question about the data. If NULL, the LLM is
asked to suggest appropriate analyses.
Logical. If TRUE, re-initiates the LLM before the task call.
Default is FALSE.
Additional arguments passed to initiate_llm().
Description of what the R code should accomplish.
Coding style for generated R code: "tidyverse" (default) or
"base".
A character string containing R code to explain or improve.
Level of detail for explanations: "brief" (one paragraph,
default) or "detailed" (step-by-step).
Optional description of what the plot should show.
A character string with the LLM response (suggestions, code, or explanation).