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.
npx agentmods add skills/leolin990405/r-analytics-skill/r-spatialnpx skills add LeoLin990405/r-analytics-skill --skill r-spatialgit clone --depth 1 https://github.com/LeoLin990405/r-analytics-skillWrote 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.
[](https://agentmods.dev/skills/leolin990405/r-analytics-skill/r-spatial)<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/r-spatial"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/r-spatial.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00023 | $0.01157 |
| Opus 5 | $0.00012 | $0.00579 |
| Sonnet 5 | $0.00005 | $0.00231 |
| Haiku 4.5 | $0.00002 | $0.00116 |
Grade A, and why
r-spatial 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 188 lines — stays where its author put it; the contents beside it link to each section on GitHub.
R Spatial Analysis Skill
Sub-skills
| Sub-skill | Description |
|---|---|
| r-spatial-vector | sf, sp, terra vectors, geometric operations |
| r-spatial-raster | terra, raster, stars, gridded data |
| r-spatial-mapping | tmap, leaflet, mapview, ggplot2+sf |
Geographic and spatial data analysis in R.
Core Spatial Packages
| Package | Description |
|---|---|
| sf ★ | Simple Features for R (modern) |
| terra ★ | Spatial data analysis (raster/vector) |
| sp | Classes for spatial data (legacy) |
| rgdal | Geospatial Data Abstraction Library |
| rgeos | Geometry Engine - Open Source |
Mapping & Visualization
| Package | Description |
|---|---|
| leaflet ★ | Interactive maps |
| tmap ★ | Thematic maps |
| ggmap | Maps with ggplot2 |
| maptools | Spatial object tools |
| RColorBrewer | Color schemes for maps |
| REmap | ECharts maps |
Spatial Statistics
| Package | Description |
|---|---|
| spatstat | Spatial point pattern analysis |
| gstat | Geostatistical modeling |
| spdep | Spatial dependence |
| GWmodel | Geographically-weighted models |
Spatio-temporal
| Package | Description |
|---|---|
| spacetime | Spatio-temporal data |
Data Sources
| Package | Description |
|---|---|
| tigris | US Census TIGER shapefiles |
| rnaturalearth | Natural Earth map data |
| osmdata | OpenStreetMap data |
Quick Examples
# sf basics
library(sf)
# Read shapefile
shp <- st_read("data.shp")
# Read GeoJSON
geo <- st_read("data.geojson")
# Create from coordinates
points <- st_as_sf(df, coords = c("lon", "lat"), crs = 4326)
# Coordinate reference systems
st_crs(shp)
shp_transformed <- st_transform(shp, crs = 3857)
# Spatial operations
st_intersection(a, b)
st_union(a, b)
st_buffer(points, dist = 1000)
st_area(polygons)
st_distance(a, b)
# Spatial joins
st_join(points, polygons)
# Interactive map with leaflet
library(leaflet)
leaflet(shp) %>%
addTiles() %>%
addPolygons(
fillColor = ~colorQuantile("YlOrRd", value)(value),
weight = 1,
popup = ~name
)
# Static map with tmap
library(tmap)
tm_shape(shp) +
tm_polygons("value",
style = "quantile",
palette = "Blues",
title = "Value"
) +
tm_layout(title = "Map Title")
# ggplot2 + sf
library(ggplot2)
ggplot(shp) +
geom_sf(aes(fill = value)) +
scale_fill_viridis_c() +
theme_minimal()
# Spatial statistics
library(spdep)
# Create neighbors
nb <- poly2nb(shp)
# Spatial weights
lw <- nb2listw(nb)
# Moran's I
moran.test(shp$value, lw)
# Geostatistics
library(gstat)
# Variogram
v <- variogram(value ~ 1, data = points)
plot(v)
# Kriging
v.fit <- fit.variogram(v, vgm("Sph"))
kriged <- krige(value ~ 1, points, grid, v.fit)
What ships with it
22 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- r-spatial-analysis/sp/SKILL.md 3.3 KB
- r-spatial-analysis/spatstat/SKILL.md 3.3 KB
- r-spatial-mapping/cartography/SKILL.md 1.8 KB
- r-spatial-mapping/ggmap/SKILL.md 1.6 KB
- r-spatial-mapping/mapsf/SKILL.md 1.9 KB
- r-spatial-mapping/mapview/SKILL.md 1.4 KB
- r-spatial-mapping/SKILL.md 1.7 KB
- r-spatial-mapping/tmap/SKILL.md 1.5 KB
- r-spatial-raster/raster/SKILL.md 1.9 KB
- r-spatial-raster/SKILL.md 1.2 KB
- r-spatial-raster/stars/SKILL.md 1.3 KB
- r-spatial-raster/terra/SKILL.md 1.3 KB
- r-spatial-vector/maptools/SKILL.md 1.0 KB
- r-spatial-vector/rgdal/SKILL.md 967 B
- r-spatial-vector/rgeos/SKILL.md 1.2 KB
- r-spatial-vector/sf/SKILL.md 2.7 KB
- r-spatial-vector/SKILL.md 1.4 KB
- sub-skills/r-spatial-mapping/sub-skills/ggmap/SKILL.md 1.6 KB
- sub-skills/r-spatial-mapping/sub-skills/mapview/SKILL.md 1.4 KB
- sub-skills/r-spatial-mapping/sub-skills/tmap/SKILL.md 1.5 KB
- sub-skills/r-spatial-raster/sub-skills/stars/SKILL.md 1.3 KB
- sub-skills/r-spatial-raster/sub-skills/terra/SKILL.md 1.3 KB
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.
- 2d ago First seen · 188 lines · 23 tokens per session scan A c8190097db3d
r-spatial is a skill published in the GitHub repository LeoLin990405/r-analytics-skill (5 stars, last pushed 5mo ago), licensed MIT. It adds 23 tokens to every session and 1,157 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.
Other skills, from other repositories
bio-applied-bio-data-formats
Parse/write FASTA, FASTQ, SAM/BAM, VCF, BED, GFF/GTF with pysam and pure Python; decode SAM FLAG/CIGAR; reconcile 0-based vs 1-based coordinates. Use for custom format parsers or off-by-one coordinate bugs.
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.
bio-applied-mageck-gene-essentiality
Run MAGeCK count/test on pooled CRISPR sgRNA screens, scoring gene essentiality via RRA, FDR, and log2 fold-change. Use when analyzing CRISPR screen FASTQ/count data, calling essential or drug-resistance genes, or benchmarking vs DepMap.
bio-applied-molecular-evolution
Test Hardy-Weinberg equilibrium, simulate Wright-Fisher drift/selection, and compute dN/dS, Tajima's D, and Fst with NumPy/SciPy. Use for neutral theory, molecular clock divergence time, selection scans, or effective population size (Ne) questions.
bio-applied-network-modules
Detect PPI/co-expression modules with NetworkX/python-louvain/leidenalg (Louvain, Leiden, modularity Q) and WGCNA eigengenes. Use when clustering a gene network, computing WGCNA modules, or testing DEG/pathway enrichment on network communities.
bio-applied-ribo-seq
Ribo-seq: cutadapt/bowtie2 adapter+rRNA removal, plastid P-site calibration, 3-nt periodicity QC, RiboCode/ribotricer ORF calling, translation efficiency. Use when user has ribosome profiling or footprint data.