Welcome!

LLMs for Data Analysis in R

R/Medicine 2026

Welcome to LLMs for Data Analysis in R!

Workshop repo: https://github.com/skaltman/r-medicine-llm


☁️ Launch Instruqt environment:

  1. Go to https://play.instruqt.com/posit/invite/18ocdvpujl2t
  2. Click Start
  3. It will take a few minutes to start up. When it’s ready, click the green Start button.
  4. Click Open external Window
  5. Open RStudio or Positron

About this workshop

👋 Introductions

🏡 skaltman.github.io/r-medicine-llm

All slides and info lives here!

Workshop format

📊 Slides

💻 Demos

✏️ Exercises in Instruqt environment

Ask questions at any point in the chat

Your Turn

Set up Instruqt:

  1. Go to https://play.instruqt.com/posit/invite/omatxsihs3we
  2. Click Start
  3. It will take a few minutes to start up. When it’s ready, you’ll click the green Start button. (don’t worry if you don’t get to this)
01:00

Schedule

Activity
👋 Intro
💬 LLM APIs from R
Break
🛠️ Tool calling
🤖 Apps and coding agents
🌳 Privacy and security

File organization

_exercises/ Files for Your Turn exercises
_solutions/ Solutions to those exercises
_demos/ Files for demos

Let’s Dive In!

To use an LLM API…

…you (generally) need an API key!

How to get an API key, beyond this workshop

  1. 🆙 Sign up for an account with OpenAI, Anthropic, etc.

  2. 💳 Add a payment method

  3. 🔑 Get an API key

  4. 💾 Store it in .Renviron file
    as OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.

(or your organization provides them to you)

But we’ll give you API keys to use today!

  1. Use these keys for all of our activities today

  2. Explore! But please be considerate :)

  3. We’ll turn them off at the end of the workshop

Our Turn

Instruqt should now be ready to open.

  1. Click the green Start button, then Open external window.
  2. Click New Session and select either RStudio Pro or Positron Pro.
  3. Click Launch.
  4. Open the r-medicine-llm-exercises folder (do not create a project).

🔑 Set up keys:

  1. Copy the code in the provided Google Doc.
  2. Paste it into the R console and run.

🤖 Check that everything’s working:

  • Run the code in _exercises/01_hello-llm/01_hello-llm.R
02:00