Skip to content
Coming soon: Ally. Your guide to the world of AI and R. Learn More →
R for the Rest of Us Logo

How to Get Started Using AI with R

There are so many ways to use AI with R now that it's genuinely hard to know where to start. Should you just use ChatGPT in a browser tab? Install something into your code editor? And if so, which one?

I made a video walking through the main options, with the pros and cons of each.

The simplest approach is the one most people start with. Pop open ChatGPT in a browser and ask it R questions the same way you'd ask anything else. It works, but you end up bouncing back and forth between the browser and your editor, copying error messages over and pasting fixes back. It's fine for the occasional question. It's not great as a way of working.

The more interesting approaches put the AI directly inside your editor, so it can actually see your code. I cover two of them:

  • Claude Code, which installs as an extension in Positron (or VS Code) and can read your file, explain errors, edit your code for you, and help you debug. It's a general-purpose coding agent, so it's not R-specific, but it's excellent.

  • Posit Assistant, which is Posit's new data-science-focused assistant. Similar idea to Claude Code, but it works in RStudio as well as Positron, and it can actually run the code it writes for you. Claude Code edits, but leaves you to re-run.

Both are paid (around $20/month each at the plans I use), and honestly, once you've tried working this way it's hard to go back. Highlighting three lines of broken code and asking "why isn't this working?", then getting a fix written into your file a few seconds later, is a very different experience from copy-pasting error messages into a browser.

A quick caveat: Posit Assistant is very new, and there's also an older thing called Positron Assistant floating around. Ignore Positron Assistant. Posit Assistant is where things are heading.

Good luck, and have fun playing around with these. If you've been on the fence about whether AI tools are worth it for R work, I think the in-editor options are the ones that'll change your mind.

Sign up for the newsletter

Get blog posts like this delivered straight to your inbox.

Let us know what you think by adding a comment below.

You need to be signed-in to comment on this post. Login.

David Keyes
By David Keyes
May 27, 2026

Sign up for the newsletter

R tips and tricks straight to your inbox.