Connects Claude Code or OpenCode to RStudio to execute R scripts, analyze data, and create visualizations.

Install

mkdir -p .claude/skills/claude-r && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14752" && unzip -o skill.zip -d .claude/skills/claude-r && rm skill.zip

Installs to .claude/skills/claude-r

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Execute R code through RStudio via MCP. Use for R programming tasks, statistical analysis, data visualization, or setting up/troubleshooting the RStudio integration with Claude Code or OpenCode.
194 chars✓ has a “when” trigger
Advanced

Key capabilities

  • →Execute R code and return text output
  • →Generate plots from R code as PNG images
  • →Query R environment for packages, variables, or version
  • →Retrieve the currently open file in RStudio
  • →Modify code sections in the active RStudio document
  • →Set up R and its dependencies

How it works

This skill connects an AI assistant to RStudio, allowing it to generate and execute R code through an MCP server. RStudio acts as the execution engine, displaying results.

Inputs & outputs

You give it
R code or query for R environment
You get back
Text output from R, PNG plot image, or R environment information

When to use claude-r

  • →Executing R code for statistical analysis
  • →Generating data visualizations using ggplot2
  • →Querying installed R packages and workspace variables
  • →Troubleshooting RStudio integrations for AI coding assistants

About claude-r

This skill enables an AI coding assistant to execute R code by connecting to an RStudio instance via the Model Context Protocol (MCP). It allows users to run statistical analyses, generate plots, and query the R environment directly from the AI terminal.

Execute R code through RStudio via MCP. Use for R programming tasks, statistical analysis, data visualization, or setting up/troubleshooting the RStudio integration with Claude Code or OpenCode.

When not to use it

  • →When RStudio is not running or connected
  • →When the task does not involve R programming or statistical analysis
  • →When the user does not want to interact with R through an AI assistant

Prerequisites

RStudioClaudeR R packagehttpx Python packagemcp Python package

Limitations

  • →Execution is single-threaded
  • →The server binds to localhost only
  • →RStudio must be running with the server active

How it compares

This skill enables an AI assistant to directly interact with an RStudio instance, automating R code execution and environment queries, unlike manual R programming.

Compared to similar skills

claude-r side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
claude-r (this skill)07moReviewAdvanced
streamlit8611moNo flagsIntermediate
openalex-database489moReviewIntermediate
data-storytelling474moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

Search skills

Search the agent skills registry