Update the examples in the roxygen2 documentation for explain() to show off more of the arguments. For instance, using the following example from the ISLR book:
Bike sharing exampke from
Bikeshare <- ISLR2::Bikeshare
# Fit a Poisson regression model to the bike sharing data set
fm <- glm(bikers ~ mnth + hr + workingday + temp + weathersit,
data = Bikeshare, family = poisson)
# Additional context for the LLM to consider when explaining the model's output
context <- "
The data contain the hourly and daily count of rental bikes between years 2011
and 2012 in Capital bikeshare system, along with weather and seasonal
information. The variables in the model include:
* bikers - Total number of bikers.
* mnth - Month of the year, coded as a factor.
* hr - Hour of the day, coded as a factor from 0 to 23.
* workingday - Is it a work day? Yes=1, No=0.
* temp - Normalized temperature in Celsius. The values are derived via
(t-t_min)/(t_max-t_min), t_min=-8, t_max=+39.
* weathersit - Weather, coded as a factor.
"
# Use Google Gemini to explain the output; requires an API key; see
# ?ellmer::chat_google_gemini for details
client <- ellmer::chat_google_gemini(echo = "none")
explain(fm, client = client, context = context, audience = "student",
verbosity = "brief", style = "text")
Note: For AI Agents/LLMs proposing a fix, keep in mind that the only changes to fix this issue should occur in the @examples section between \dontrun{ and }.
Update the examples in the roxygen2 documentation for
explain()to show off more of the arguments. For instance, using the following example from the ISLR book:Note: For AI Agents/LLMs proposing a fix, keep in mind that the only changes to fix this issue should occur in the
@examplessection between\dontrun{and}.