LLMs in R for Data Analysis
rainbowR Conference Workshop
by Nic Crane
Wednesday 25th February 2026, 19:00-21:00 UTC / 14:00-16:00 ET / 11:00-13:00 PT
Workshop Overview
LLMs can be massively useful in R workflows, when used in the right places and if you’re aware of not only the benefits, but also the risks. In this hands-on workshop, you’ll learn how to use LLMs programmatically in R, and come away with both the confidence to experiment and a working script that extracts data from unstructured text.
We’ll look at where LLMs can help, where they’ll let you down, and techniques for making your results more trustworthy. You’re going to leave with a practical sense of what’s possible and where to be cautious.
What you’ll learn:
- Getting started with LLMs in R using {ellmer}
- Prompt engineering for more predictable results
- Extracting structured data from unstructured text
- Using LLMs to call R functions (tool calling)
Workshop Prework
Environment
You’ll need an R environment to work in; this could be RStudio or Positron on your own laptop, or an account on Posit Cloud via a web browser.
If you’re on a work machine with restrictions on installing software or connecting to external APIs, Posit Cloud is a good option as everything runs in your browser.
Packages
Install the required packages:
install.packages(c("ellmer", "dplyr", "readr", "tidyr", "usethis"))API keys
You’ll need an API key from an LLM provider. You will have been sent this on the day of the workshop.
Workshop Schedule
- Section 0: Welcome and Setup
- Section 1: Getting Started with LLMs in R
- Section 2: Prompt Engineering
- Section 3: Structured Output
- Section 4: Tool Calling
- Section 5: Wrap-up and Resources
Instructor
Nic Crane is an R consultant with a background in data science and software engineering. They are passionate about open source, and learning and teaching all things R.
Code
All the code from the workshop can be found on the Code and Exercises page.
Copyright © 2026 Nic Crane. All Rights Reserved.