/r-package-skills:r-ellmerfrom r-package-skills
Provides an R interface to 20+ LLM providers (OpenAI, Claude, Ollama) with stateful chat, tool calling, and token tracking. Use when building chatbots or extracting structured data from R.
Ships in r-package-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
ellmer is the hub of the R AI stack. Provides unified interface to 20+ LLM providers (OpenAI, Claude, Ollama, etc.) with stateful chat sessions, tool calling, and token tracking.
Install: install.packages("ellmer")
API keys: Set OPENAI_API_KEY or ANTHROPIC_API_KEY in .Renviron
Read references/API.md before writing code.
references/API.md - Complete function referencereferences/getting-started.md - Core workflow and chat patternsreferences/tool-calling.md - Tool registration and function calling# Create chat
chat <- chat_openai(model = "gpt-4o")
chat <- chat_claude(model = "claude-sonnet-4")
chat <- chat_ollama(model = "llama3.2") # Local
# Chat (stateful - history preserved)
chat$chat("Explain this error")
chat$chat("How do I fix it?") # Remembers context
# Fresh conversation
chat <- chat_openai() # New = no history
# Track costs
token_usage()
# Tool calling
chat$set_tools(btw_tools()) # See r-btw skill
| Issue | Solution |
|---|---|
| Forgot API key | Set in .Renviron, restart R |
| Ollama connection error | Run ollama serve first |
| Conversation too long/expensive | Start fresh chat for new topics |
| Expecting accuracy | LLMs for prototyping, not critical work |
| Using chat for single request | Just use httr2 for one-off calls |
Custom chatbots: Preload with documentation, package info, educational materials
Structured data extraction: Sentiment analysis, geocoding, recipe parsing, document indexing
Programming assistance: Code modernization, documentation lookup, explanation, security analysis
Other: Alt text generation, statistical reasoning, brand style guide enforcement
See references/ for:
With btw (context tools): See r-btw skill With ragnar (RAG): See r-ragnar skill With vitals (evaluation): See r-vitals skill Cross-package patterns: See r-ai meta-skill
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
14 skills in this plugin
/r-aiUse when code loads ellmer, btw, mcptools, ragnar, or vitals, building LLM-powered R applications, implementing RAG workflows, or choosing between R AI packages (meta-skill for ellmer/btw/mcptools/ragnar/vitals)/r-btwUse when code loads or uses btw (library(btw), btw::), providing R session context to LLMs, registering tools for ellmer chat, or copying R object descriptions to clipboard/r-collapseUse when code loads or uses collapse (library(collapse), collapse::), performing fast grouped or weighted statistics in R, or seeking faster alternatives to dplyr aggregation/r-duckplyrUse when code loads or uses duckplyr (library(duckplyr), duckplyr::), processing large datasets with dplyr syntax, working with Parquet files in R, or needing lazy evaluation for bigger-than-memory data/r-duckspatialUse when code loads or uses duckspatial (library(duckspatial), duckspatial::), performing spatial joins or areal interpolation on large vector datasets in R, or needing faster spatial operations than sf/r-flextableUse when code loads or uses flextable (library(flextable), flextable::), creating formatted tables for Word (.docx), PowerPoint (.pptx), HTML, or PDF in R, or needing merged cells and conditional formattingnpx claudepluginhub arthurgailes/r-package-skills --plugin r-package-skillsOther plugins' skills for the same job