r/rstats • • 18h ago

I just published rairai on CRAN! It’s an MCP server built to speed up R package development.

0 Upvotes

Hi folks! If you use AI coding agents to develop R packages, you might find rairai useful. It’s an MCP server that uses Tree-sitter to give agents a structured view of an R package. For example, an agent can find where a function is defined and used, check what the package imports, or look up a help page. Think of it as a language server designed for AI agents.

I built rairai out of frustration with a few things I kept seeing in my own work. I’d watch an agent burn tokens searching for a function and fill its context with unrelated code along the way. Sometimes it would miss that a function was already imported and add namespace prefixes where they weren’t needed. Other times it would guess what an argument did or what a function returned instead of checking the docs, and miss an important side effect.

The idea behind rairai is simple: give agents easy access to the same information I’d look up myself. Language servers are built around what an editor needs. I built `rairai` around the questions I want an agent to ask, like “What should I check before changing this function?” The goal is to get the relevant information in one call without filling the context with unrelated code.

You can find it on CRAN, and the source is on GitHub. If you try it on one of your own packages, I’d love to hear what worked and what you’d change!


r/rstats • • 23h ago

Is AI there yet?

0 Upvotes

I have only used the free tiers of the most popular AI chats for some code generation. And it takes at least 50 whips, before an acceptable output.

Can the newest, paid versions really work from start to finish on their own? Or are the people on Twitter having an AI psychosis?


r/rstats • • 13h ago

Swirl: Lessons do not load. Help

Post image
2 Upvotes

Hi. Im trying to learn R with Swirl, but from lesson 10 onwards I get the error shown in the screenshot.

I am super confused. I tried searching the directory but found no folder named "AppData" inside "Usuario". The apps "R-4.6.2-win" "R_Programming_E" and company are all in my Downloads folder,

I dont get why its trying to search a folder that never existed and never told me to create.

I dont know if the solution is obvious and im just too tired, or if this s a bug im unaware of.

Can someone help me?

Thank you for reading this far


r/rstats • • 16h ago

Looking for online courses or books to learn statistical analysis in R for social sciences

8 Upvotes

Hi everyone!

I have a bachelor's and a master's degree in Political Science, and I'm looking for a beginner-friendly online course or book that teaches quantitative methods using R, specifically for social research (i.e. social statistics with R for sociology, political science, and the social sciences more broadly).

I'm not looking for an online course or book that covers the entirety of R for every possible statistical method, as that would be far too broad. I'd like something focused on quantitative methods for social sciences, starting from the basics. I had a statistics class, but unfortunately it was just theoretical, with no software involved. I assume the online course or book would include, for example:**

• descriptive statistics

• hypothesis testing

• most importantly, regression analysis using R.

Any advice?