text2vec

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

An R package for turning text into tokens, numeric tables, and word vectors. It includes methods such as GloVe, which learns relationships between words from how often they appear together.

In plain words
What is it for?
Use it to tokenize documents, create term-frequency tables, calculate TF-IDF, train word embeddings, and explore topics.
Why use it?
It provides reusable text-processing steps instead of requiring you to build vectorization and embedding code yourself.

Skill for Claude CodeCodex

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

Good fit Use it to tokenize documents, create term-frequency tables, calculate TF-IDF, train word embeddings, and explore topics.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leolin990405/r-analytics-skill/text2vec
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 text2vec
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 text2vec

README.md
[![agentmods](https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/text2vec/github.svg)](https://agentmods.dev/skills/leolin990405/r-analytics-skill/text2vec)
Your own site
<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/text2vec"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/text2vec/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 text2vec

Your own site · 80×15
<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/text2vec"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/text2vec.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 466 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.00028 $0.00466
Opus 5 $0.00014 $0.00233
Sonnet 5 $0.00006 $0.00093
Haiku 4.5 $0.00003 $0.00047

Measured 9d ago against content hash badfeb8a7df8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

text2vec 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 9d 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-nlp/r-nlp-text/text2vec/SKILL.md · 92 lines

What it actually says

text2vec Package

Fast text vectorization and embeddings.

Tokenization

library(text2vec)

# Iterator
it <- itoken(texts,
  preprocessor = tolower,
  tokenizer = word_tokenizer
)

# From files
it <- ifiles("*.txt") %>%
  itoken(tokenizer = word_tokenizer)

Vocabulary

# Create vocabulary
vocab <- create_vocabulary(it)

# Prune
vocab <- prune_vocabulary(vocab,
  term_count_min = 5,
  doc_proportion_max = 0.5
)

# Vectorizer
vectorizer <- vocab_vectorizer(vocab)

Document-Term Matrix

# Create DTM
dtm <- create_dtm(it, vectorizer)

# TF-IDF
tfidf <- TfIdf$new()
dtm_tfidf <- fit_transform(dtm, tfidf)

Word Embeddings (GloVe)

# Co-occurrence matrix
tcm <- create_tcm(it, vectorizer, skip_grams_window = 5)

# Train GloVe
glove <- GloVe$new(rank = 100, x_max = 10)
word_vectors <- glove$fit_transform(tcm, n_iter = 20)

# Get word vector
word_vectors["king", ]

# Word analogies
king <- word_vectors["king", ]
man <- word_vectors["man", ]
woman <- word_vectors["woman", ]
queen_vec <- king - man + woman

Topic Modeling (LDA)

lda <- LDA$new(n_topics = 10)
doc_topics <- lda$fit_transform(dtm, n_iter = 100)

# Top words per topic
lda$get_top_words(n = 10)

Similarity

# Cosine similarity
sim <- sim2(dtm[1:10, ], dtm, method = "cosine")

# Jaccard
sim <- sim2(dtm, method = "jaccard")
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. 9d ago First seen · 92 lines · 28 tokens per session scan A badfeb8a7df8

Subscribe to this mod's changes

text2vec is a skill published in the GitHub repository LeoLin990405/r-analytics-skill (5 stars, last pushed 6mo ago), licensed MIT. It adds 28 tokens to every session and 466 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

ai-science-diffusion-generative-models

Code DDPM/DDIM diffusion samplers, linear/cosine noise schedules, and DDRM inverse-problem solving (denoising, inpainting, super-resolution) in NumPy/PyTorch. Use for forward/reverse diffusion, score matching, or DDIM sampling.

Pavel-Kravchenko/Bioinformatics · 67 tokens

ai-science-esm2-embeddings

Generate ESM2 protein embeddings (fair-esm/transformers) and predict structure with ESMFold. Use when embedding sequences, scoring mutations zero-shot, annotating protein function, or doing fast MSA-free structure prediction.

Pavel-Kravchenko/Bioinformatics · 56 tokens

ai-science-geneformer-scgpt

Tokenize scRNA-seq via Geneformer gene-rank or scGPT expression-bin encoding; annotate cell types, simulate in-silico knockouts. Use for foundation-model cell annotation, Geneformer/scGPT tokenization, or perturbation prediction.

Pavel-Kravchenko/Bioinformatics · 60 tokens

ai-science-zero-shot-mutation

Score protein point mutations zero-shot with ESM-1v/ESM-2 masked-LM log-odds, ensembled, benchmarked on ProteinGym DMS. Use when predicting mutation effects, ranking missense variants, scoring VUS fitness with no labels.

Pavel-Kravchenko/Bioinformatics · 63 tokens

bio-applied-cancer-transcriptomics

Classify tumor RNA-seq into subtypes (melanoma Tirosh/Harbst on TCGA-SKCM): log1p/z-score, PCA/t-SNE, hierarchical clustering, random forest, Kaplan-Meier survival. Use when subtyping cBioPortal expression data.

Pavel-Kravchenko/Bioinformatics · 67 tokens

bio-applied-data-harmonization

Harmonize multi-omics data (RNA-seq, proteomics, methylation, metabolomics) before integration — per-layer normalization, KNN/half-minimum missing-value imputation, PCA/PVCA batch-effect detection, and ComBat correction with pandas/scikit-learn. Use when prepping matrices for MOFA2/DIABLO/mixOmics, fixing missing…

Pavel-Kravchenko/Bioinformatics · 106 tokens