Wirewalk Instituteof AI
dev-208 Intermediate Waitlist

R for AI and Statistical Workflows

For statisticians, data scientists and analysts who work in R and need to call LLMs reproducibly, extract structured data from text at scale, and keep AI-assisted analysis statistically sound.

The curriculum is being prepared and reviewed. Enrollment is not open yet.

About this course

R users now have a mature, tidy toolkit for working with language models. The ellmer package provides one interface to OpenAI, Anthropic, Gemini, Ollama and other providers, with tool calling, typed structured output via type_object and friends, and parallel_chat and batch_chat for running thousands of prompts. Around it sit ragnar for retrieval, vitals for evaluation, shinychat and querychat for applications, mall for row-wise LLM operations on data frames, and btw and mcptools for connecting R sessions to AI assistants.

This course teaches you to use that toolkit as a statistician would. You will extract structured variables from free text into tidy data, measure how reliable that extraction is against hand-coded samples, and treat model output as a measurement with error rather than ground truth. You will run large jobs with parallel and batch APIs and asynchronous code with mirai and promises, use local models for sensitive data, build retrieval over your documents, and ship Shiny apps with chat interfaces. You will keep everything reproducible with renv, pinned model versions, cached responses and testthat tests that replay recorded HTTP with vcr or httptest2. The course also covers AI coding assistance in RStudio and Positron and how to check generated analysis code. Package versions are as of October 2026 (R 4.6, ellmer 0.5).

What you will be able to do

  • Call OpenAI, Anthropic, Gemini and local Ollama models from R with ellmer, including tool calling and multi-turn conversations
  • Extract typed, structured variables from free text into a data frame and validate the extraction against a hand-coded sample with agreement statistics
  • Run large prompt workloads efficiently with parallel_chat, batch_chat and asynchronous R, within rate and cost limits
  • Build a retrieval workflow over local documents with ragnar and evaluate answer quality with vitals
  • Build a Shiny application with a chat interface or natural-language data filtering using shinychat or querychat
  • Make LLM-assisted analyses reproducible with renv, pinned models, cached responses and testthat tests using recorded HTTP
  • Review AI-generated R code and statistical claims for errors before they reach a report

Syllabus

5 modules · 17 lessons · about 12 hours

Module 1: LLMs from R with ellmer

One interface to many providers, used the tidy way.
3 lessons
  1. ellmer chat objects: providers, system prompts, turns and token costs
  2. Tool calling from R: letting a model call your functions safely
  3. Under the hood with httr2: authentication, retries and streaming with req_perform_connection

Module 2: Structured Extraction as Measurement

Turning text into variables, and quantifying how good those variables are.
4 lessons
  1. Type specifications with type_object, type_array and enums
  2. Row-wise LLM operations on data frames with mall
  3. Validating extraction: hand-coded samples, agreement statistics and error propagation
  4. Bias, drift and sensitivity analysis when model output feeds an inference

Module 3: Scale, Concurrency and Local Models

Running many calls quickly and cheaply, and keeping sensitive data local.
3 lessons
  1. parallel_chat and batch_chat: throughput, cost and failure handling
  2. Asynchronous R with mirai and promises
  3. Local models with Ollama via ellmer and rollama for sensitive data

Module 4: Retrieval, Evaluation and Applications

Grounded answers, measured quality and interactive tools.
3 lessons
  1. Retrieval-augmented generation in R with ragnar
  2. Evaluating LLM behavior with vitals
  3. Shiny chat apps with shinychat and natural-language filtering with querychat

Module 5: Reproducible, Tested, Assisted

Engineering discipline for AI-assisted statistical work.
4 lessons
  1. Reproducibility: renv, model pinning, response caching and reporting in Quarto
  2. Testing LLM code with testthat, vcr and httptest2
  3. AI coding assistants in RStudio and Positron, and connecting your R session through btw and mcptools
  4. Reviewing AI-generated analysis code and statistical claims

Exam and certificate

The exam unlocks once you have completed every lesson. It draws 20 questions from a larger bank, spread across the modules, with the answer options shuffled for each attempt. You have 40 minutes and need 80% to pass. After a failed attempt you can try again after 24 hours, up to 3 attempts in total. Feedback is given per module, never as the answer key.

Passing earns a certificate of completion and assessment from the Wirewalk Institute of AI with a unique ID that anyone can check at institute.wirewalk.com/verify. It is not an accredited qualification or a vendor certification. How certification works.

The Wirewalk Institute of AI is independent. This course teaches publicly documented products and is not affiliated with or endorsed by Posit (ellmer, ragnar, vitals, shinychat, querychat, Positron, Posit Assistant), OpenAI, Anthropic, Google (Gemini), Ollama, GitHub Copilot, or Model Context Protocol. Product and company names are trademarks of their respective owners.

More in AI in Software Development

All 19 courses in this track
dev-001 Free intro Available

Your First AI API Call: A One-Hour Hands-On Start

A free, one-hour, hands-on start built on one realistic job: sorting a property manager's 1,150 monthly maintenance requests. You get an API key the safe way, make real calls with curl and an official Python SDK, run them over forty work orders, read stop reasons, usage and errors, estimate the monthly cost, and decide whether the script is ready. Exercises run on your own provider account for well under a dollar.

1 h · 7 lessons Free intro
dev-201 Intermediate Available

Python AI Integration: SDKs, Async, Pydantic, Packaging and Testing

A code-first course on integrating LLMs into Python the way production code needs it: uv projects and secrets, the OpenAI, Anthropic and Google GenAI SDKs side by side, async concurrency and streaming, Pydantic structured outputs and tools, retries, local models, embeddings and RAG, FastAPI and pandas integration, testing and evals with pytest, observability, cost tracking and deployment.

15 h · 19 lessons See price at checkout
dev-202 Intermediate Waitlist

Perl and AI: Modernizing Scripts and Text Pipelines with LLM APIs

Call OpenAI, Anthropic, Gemini and local Ollama models from Perl with real CPAN modules, add streaming, concurrency and validated JSON output to text pipelines, and use AI coding assistants to modernize legacy Perl behind characterization tests.

12 h · 18 lessons Join the waitlist