Skip to content

24-7 Today

Menu
  • Home
  • Ads Guide
  • Blogging
  • Sec Tips
  • SEO Strategies
Menu

Positron Assistant: GitHub Copilot and Claude-Powered Agentic Coding in R

Posted on September 10, 2025 by 24-7

[This article was first published on Getting Genetics Done, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)


Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t.

Reposted from the original at https://blog.stephenturner.us/p/positron-assistant-copilot-chat-agent 

I have a little hobby project I’m working on and I wanted to use the opportunity to fully make the switch to Positron
from RStudio. I used Positron here and there when it first came out,
but now that it’s out of beta and has a more complete feature set (like
remote SSH sessions!) I have everything I need to switch and not look back. The most exciting new addition is the new Positron Assistant.

I
wrote a post last year about AI code completion in Positron. GitHub
copilot wouldn’t work in Positron at the time so I tried out Codeium,
Tabnine, and Continue.

AI code completion in Positron

Using a third-party plugin is no longer necessary. One of the more exciting new features in Positron is Positron Assistant. From the description:

Positron
Assistant is an AI client that provides LLM integration within
Positron, both for chat and for inline completions. Use Positron
Assistant to generate or refactor code, ask questions, get help with
debugging, and get suggestions for next steps in your data science
projects.

Positron Assistant allows you to use GitHub Copilot for inline code completions, and Anthropic Claude for chat and agent mode. The documentation
has instructions for getting this set up so I won’t go into those
details. You make a configuration change in Positron, then sign into
your GitHub account with OAuth, and put in your Anthropic API key, and
you’re off to the races.

Cmd-Shift
P to bring up the command pallette in Positron, then search for
“Positron Assistant: Configure Language Model Providers.”

This
isn’t anything new. GitHub Copilot has been available in VSCode and
RStudio for years. But it’s nice to have it available in Positron now.

Here’s
a demo where I’m starting with a blank R script, and write comments in
the code describing what I want, then let Copilot take it away as I just
hit the tab key to accept the suggestions. Here I’m asking for a
function to reverse complement a DNA sequence.
Here’s the code it produced.

When Positron first came out I wrote about using it for R package development.

R package development in Positron

I wanted to try out Positron Assistant’s agent mode to see how it works with R packages. Cursor and Claude Code
seem to be all the rage on all the tech podcasts, Twitter feeds, and
blogs I follow, but I’ve been reluctant to switch IDEs (or in the case
of Claude Code, ditching the IDE altogether).

Activate the Assistant in Positron’s sidebar, then select Agent mode.

I started up a fresh R session and ran usethis::create_package()
to create a blank package. This just creates the bare minimum
(DESCRIPTION, NAMESPACE, etc.) needed for a skeleton R package. Then I
activated Positron Assistant in agent mode, asked it to write a function
in the package to reverse complement a DNA sequence, document it with
Roxygen, and write unit tests with testthat.

It’s
fun to sit back and watch the agent work. It scans the directory
structure, finds the R version, creates the function, writes the
documentation, writes the tests, then presents a model asking me whether
I want to run the tests that it just created. It wrote everything in
one shot with all tests passing and no errors on
devtools::check().

Everything you see here cost $0.09 cents using the Claude 4 Sonnet API.

The one thing I had to fix was the License field in the DESCRIPTION file with a simple usethis::use_mit_license(). The default for this field came in from usethis::create_package()
and was simply boilerplate telling me that I needed to choose a
license. Once I fixed this all tests passed, and the package check came
out clean with 0 errors, warnings, or notes.
I uploaded the package here on GitHub.

View the package code on GitHub

It
was honestly pretty mesmerizing to sit back and watch the agent do its
thing, inspecting the environment, writing code, docs, and tests.

Obviously
this was a simple greenfield example, and I’d be curious to see how the
agent handles larger codebases with complex dependencies and newer
coding paradigms (like R’s new
S7 OOP system) that won’t have good training data from Stack Overflow or elsewhere.

 

Related

Related

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

©2025 24-7 Today | Design: WordPress | Design: Facts