Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claude-R

Agentic R programming with Claude Code (or OpenCode) and RStudio.

This repo is an R project template. Clone it for each R project, and you get a ready-made environment where the assistant manages the RStudio connection via MCP. Your R scripts, data, and analysis all live in the same repo.

Supported clients: Claude Code and OpenCode (an open-source alternative to Claude Code).

You → Claude Code or OpenCode → MCP Server → RStudio

Requirements

Quick Start

In any terminal:

# Clone per project (each clone becomes its own R project workspace)
git clone https://github.com/naoto-iwase/Claude-R.git <your-project-name>
cd <your-project-name>

# Detach from the template repo so this becomes your own project
git remote remove origin

With Claude Code

claude
# Then ask: "Set up Claude-R"  or  /claude-r

With OpenCode

opencode
# Then ask: "Set up Claude-R"  or  /skills → claude-r

Example

In the assistant, you type:

"Plot mpg vs hp from mtcars with a regression line"

The assistant generates and executes:

library(ggplot2)
ggplot(mtcars, aes(x = hp, y = mpg)) +
  geom_point() +
  geom_smooth(method = "lm")

The plot appears in RStudio's Plots pane, and the assistant shows the result inline.

Other things you can ask:

"Run a t-test comparing groups A and B"
"Load data.csv and show summary statistics"

Troubleshooting

If something goes wrong, ask the assistant:

"Check Claude-R connection"
"Troubleshoot Claude-R setup"

Documentation

License

MIT

Credits

Built on ClaudeR by IMNMV.

About

Agentic R programming with Claude Code and RStudio

Resources

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages