Install
$ agentstack add skill-leolin990405-r-analytics-skill-r-analytics-skill ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
R Analytics
R language data analysis and visualization toolkit.
Quick Reference
Run R Code
# Run inline code
Rscript -e 'print("Hello R")'
# Run script file
Rscript script.R
# Run with arguments
Rscript script.R arg1 arg2
Package Management
# Update all packages
Rscript -e 'options(repos = c(CRAN = "https://cloud.r-project.org")); update.packages(ask = FALSE, checkBuilt = TRUE)'
# Install package
Rscript -e 'install.packages("tidyverse", repos = "https://cloud.r-project.org")'
# Install multiple packages
Rscript -e 'install.packages(c("ggplot2", "dplyr", "tidyr"), repos = "https://cloud.r-project.org")'
Data Analysis Workflow
1. Load Data
# CSV
df %
filter(column > 10) %>% # filter rows
select(col1, col2) %>% # select columns
mutate(new_col = col1 * 2) %>% # create column
group_by(category) %>% # group
summarise(mean_val = mean(value)) # aggregate
3. Visualization (ggplot2)
library(ggplot2)
# Scatter plot
ggplot(df, aes(x = x_col, y = y_col)) +
geom_point() +
labs(title = "Title", x = "X Label", y = "Y Label") +
theme_minimal()
# Bar chart
ggplot(df, aes(x = category, y = value, fill = category)) +
geom_bar(stat = "identity") +
theme_minimal()
# Line chart
ggplot(df, aes(x = date, y = value, color = group)) +
geom_line() +
theme_minimal()
# Save plot
ggsave("plot.png", width = 10, height = 6, dpi = 300)
ggsave("plot.pdf", width = 10, height = 6)
4. Statistical Analysis
# Summary statistics
summary(df)
# Correlation
cor(df$x, df$y)
cor.test(df$x, df$y)
# Linear regression
model <- lm(y ~ x1 + x2, data = df)
summary(model)
# T-test
t.test(group1, group2)
# ANOVA
aov_result <- aov(value ~ group, data = df)
summary(aov_result)
Common Packages
| Package | Purpose | |---------|---------| | tidyverse | Meta-package: ggplot2, dplyr, tidyr, readr, etc. | | ggplot2 | Visualization | | dplyr | Data manipulation | | tidyr | Data tidying | | readr | Fast CSV reading | | readxl | Excel files | | data.table | Fast data manipulation | | plotly | Interactive plots | | shiny | Web apps | | rmarkdown | Reports |
Output Formats
# Save data
write.csv(df, "output.csv", row.names = FALSE)
readr::write_csv(df, "output.csv")
# Save R object
saveRDS(obj, "data.rds")
obj <- readRDS("data.rds")
Resources
Scripts
- scripts/update_packages.R - Update all installed packages
References
Quick Reference:
- references/packages.md - Common packages quick reference
- references/awesome-packages.md - Curated packages by domain (ML, viz, web, finance, etc.)
- references/resources-index.md - URLs, cheat sheets, community resources
R for Data Science (2e) - Tidyverse workflow: | File | Topics | |------|--------| | references/r4ds-1-visualize.md | ggplot2: geoms, aesthetics, facets, scales, themes | | references/r4ds-2-transform.md | dplyr: filter, select, mutate, summarize, group_by | | references/r4ds-3-wrangle.md | tidyr (pivot), stringr, forcats, lubridate | | references/r4ds-4-import.md | readr, readxl, joins, binding | | references/r4ds-5-program.md | Functions, across(), map(), iteration |
Advanced R (2e) - Deep R programming: | File | Topics | |------|--------| | references/advr-1-foundations.md | Names/values, vectors, subsetting, control flow, functions, environments, conditions | | references/advr-2-functional.md | Functionals (map/reduce), function factories, function operators | | references/advr-3-oop.md | S3, R6, S4 object-oriented programming | | references/advr-4-metaprogramming.md | Expressions, quasiquotation, evaluation, code translation | | references/advr-5-techniques.md | Debugging, profiling, performance optimization, Rcpp |
R Graphics Cookbook - Visualization recipes:
- references/graphics-cookbook.md - Bar graphs, line graphs, scatter plots, distributions, annotations, colors
Ecosystems:
- references/tidyverse-ecosystem.md - Core packages, import tools, modeling, patterns
- references/bioconductor.md - Installation, GenomicRanges, RNA-seq, annotation
Sub-Skills (Domain-Specific)
| Sub-Skill | Description | |-----------|-------------| | sub-skills/r-data/ | Data manipulation, formats, databases (dplyr, data.table, DBI) | | sub-skills/r-viz/ | Visualization (ggplot2, plotly, leaflet, HTML widgets) | | sub-skills/r-ml/ | Machine learning (tidymodels, xgboost, caret, deep learning) | | sub-skills/r-nlp/ | Natural language processing (tidytext, quanteda, tm) | | sub-skills/r-web/ | Web technologies & reproducible research (Shiny, rmarkdown) | | sub-skills/r-stats/ | Bayesian analysis, optimization, finance (Stan, quantmod) | | sub-skills/r-bio/ | Bioinformatics (Bioconductor, DESeq2, GenomicRanges) | | sub-skills/r-network/ | Network analysis (igraph, tidygraph, visNetwork) | | sub-skills/r-spatial/ | Spatial analysis (sf, terra, leaflet, tmap) | | sub-skills/r-dev/ | R development (devtools, testthat, roxygen2, Rcpp) | | sub-skills/r-parallel/ | Parallel computing & performance (future, Rcpp, Spark) | | sub-skills/r-resources/ | Learning resources (books, courses, cheat sheets) |
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: LeoLin990405
- Source: LeoLin990405/r-analytics-skill
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.