Coding agents for data tasks

LLMs for Data Analysis in R

R/Medicine 2026

What is an agent?

  • Can gather information from the environment
    • e.g., what files are in a directory?
  • Can alter the environment
    • e.g., write a dataset to a file

Posit Assistant

  • Coding / data analysis agent in RStudio and Positron

  • Works with R and Python

  • Access to your R/Python session

  • Successor to Databot

Demo

Add memory with AGENTS.md

  • Markdown file that stores persistent context about your project

  • Loaded automatically at the start of every conversation

  • Include info like project structure, coding conventions, preferred libraries, etc.

Skills

  • Specialized knowledge modules that load automatically when relevant

  • Built-in skills include shiny-bslib, quarto-authoring, and more

  • Create your own: project-level (.positai/skills/) or user-level (~/.positai/skills/)

Our Turn: Set up Posit Assistant

Your Turn: Extend the querychat app

  1. Open _exercises/08_posit-assistant/08_posit-assistant-app.R and run it to confirm it works.

  2. Open Posit Assistant (sidebar or Cmd+Shift+P > “Assistant”).

  3. Ask it to help you extend the app (for example, add a plot).

  4. Run the app and continue iterating.

06:00