Rcpp

Rcpp is a skill for Claude Code, Codex from LeoLin990405/r-analytics-skill. It costs 21 tokens per session (749 once invoked), scanned A, original, MIT.

An interface for connecting R with C++, a compiled programming language that can run performance-critical code quickly. It supports R vectors, matrices, lists, and data frames.

In plain words
What is it for?
Use it to write inline or file-based C++ functions, compile them from R, and work with R data structures.
Why use it?
It makes it easier to add C++ functions to R programs without manually handling all the language boundary details.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to write inline or file-based C++ functions, compile them from R, and work with R data structures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leolin990405/r-analytics-skill/rcpp
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LeoLin990405/r-analytics-skill --skill rcpp
Clone the repo
git clone --depth 1 https://github.com/LeoLin990405/r-analytics-skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Rcpp

README.md
[![agentmods](https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/rcpp/github.svg)](https://agentmods.dev/skills/leolin990405/r-analytics-skill/rcpp)
Your own site
<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/rcpp"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/rcpp/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Rcpp

Your own site · 80×15
<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/rcpp"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/rcpp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 749 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.00749
Opus 5 $0.00010 $0.00375
Sonnet 5 $0.00004 $0.00150
Haiku 4.5 $0.00002 $0.00075

Measured 8d ago against content hash 6a1acdc66f74, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

Rcpp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sub-skills/r-language-api/Rcpp/SKILL.md · 170 lines

How it starts

The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rcpp

Seamless R and C++ integration.

Basic Function

// myfile.cpp
#include <Rcpp.h>
using namespace Rcpp;

// [[Rcpp::export]]
double sumC(NumericVector x) {
  int n = x.size();
  double total = 0;
  for (int i = 0; i < n; i++) {
    total += x[i];
  }
  return total;
}
library(Rcpp)
sourceCpp("myfile.cpp")
sumC(1:10)

Inline C++

library(Rcpp)

cppFunction('
  double sumC(NumericVector x) {
    int n = x.size();
    double total = 0;
    for (int i = 0; i < n; i++) {
      total += x[i];
    }
    return total;
  }
')

sumC(1:10)

Vector Types

// Numeric
NumericVector x;
NumericMatrix m;

// Integer
IntegerVector x;
IntegerMatrix m;

// Character
CharacterVector x;

// Logical
LogicalVector x;

// List
List L;

// DataFrame
DataFrame df;

Vector Operations

// [[Rcpp::export]]
NumericVector vecOps(NumericVector x) {
  // Create vector
  NumericVector y(10);
  NumericVector z = clone(x);

  // Access elements
  double first = x[0];
  double last = x[x.size() - 1];

  // Named access
  x["a"] = 1.0;

  // Sugar functions
  NumericVector result = sqrt(x) + log(x);

  return result;
}

Matrix Operations

// [[Rcpp::export]]
NumericMatrix matOps(NumericMatrix m) {
  int nrow = m.nrow();
  int ncol = m.ncol();

  // Access element
  double val = m(0, 0);

  // Row/column
  NumericVector row = m.row(0);
  NumericVector col = m.column(0);

  return m;
}

Return List

// [[Rcpp::export]]
List returnList(NumericVector x) {
  return List::create(
    Named("mean") = mean(x),
    Named("sd") = sd(x),
    Named("data") = x
  );
}

DataFrame

// [[Rcpp::export]]
DataFrame createDF() {
  return DataFrame::create(
    Named("x") = NumericVector::create(1, 2, 3),
    Named("y") = CharacterVector::create("a", "b", "c")
  );
}

Sugar Functions

// Rcpp sugar provides R-like syntax
NumericVector y = abs(x);
NumericVector y = sqrt(x);
NumericVector y = exp(x);
NumericVector y = log(x);
double s = sum(x);
double m = mean(x);
double v = var(x);
double sd = sd(x);
double mn = min(x);
double mx = max(x);

Read the full file on GitHub · 170 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 170 lines · 21 tokens per session scan A 6a1acdc66f74

Subscribe to this mod's changes

Rcpp is a skill published in the GitHub repository LeoLin990405/r-analytics-skill (5 stars, last pushed 5mo ago), licensed MIT. It adds 21 tokens to every session and 749 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

foundations-bash-scripting

Write robust Bash scripts to batch-process FASTQ/BAM/VCF/FASTA files: variables, set -euo pipefail error handling, loops over sample sheets, functions, traps, and awk/sed text processing. Use when automating a multi-sample pipeline, writing a shell wrapper around samtools/bcftools/fastqc/blast, validating CLI input…

Pavel-Kravchenko/Bioinformatics · 100 tokens

bun-ffi

This skill should be used when the user asks about "bun:ffi", "foreign function interface", "calling C from Bun", "native libraries", "dlopen", "shared libraries", "calling native code", or integrating C/C++ libraries with Bun.

secondsky/claude-skills · 56 tokens

cpp-mentor

A general, self-adapting C++ mentor for any project. On first run with an empty profile it onboards: settles the goal and domain, derives a namespace from the goal, agrees conventions including the project's own error policy, and audits the developer's level in both C++ and the project's topic — with questions…

sectapunterx/cpp-mentor · 249 tokens

fused-overview

Orientation to what Fused is and when to use it. Use when deciding whether to use Fused for a task, planning a new Fused project, or understanding Fused's capabilities as a remote Python execution platform.

fusedio/skills · 49 tokens

wp-php-architecture

WordPress PHP architecture patterns — repository, service layer, DDD, SOLID, plugin/theme structure, CPT design, and anti-patterns. The definitive reference for professional WordPress PHP development.

xonack/wp-php-architecture-claude-skill · 45 tokens

python-bio-classes

Build Python classes for Gene/DNA/RNA/Protein records with eq/lt/hash, @property validation, ABCs, and @classmethod parsers (fromfastastring). Use when modeling genes/FASTA/GFF as objects or asked about Python OOP, inheritance, dataclasses.

Pavel-Kravchenko/Bioinformatics · 69 tokens