R stringdist package for string distance. Use for approximate string matching and distance metrics.
Scanned 6/4/2026
Install via CLI
openskills install LeoLin990405/r-analytics-skill---
name: stringdist
description: R stringdist package for string distance. Use for approximate string matching and distance metrics.
---
# stringdist
Approximate string matching and string distance functions.
## String Distance
```r
library(stringdist)
# Single comparison
stringdist("hello", "hallo")
# Multiple comparisons
stringdist(c("hello", "world"), c("hallo", "word"))
```
## Distance Methods
```r
# Levenshtein (default)
stringdist("hello", "hallo", method = "lv")
# Optimal string alignment
stringdist("hello", "hallo", method = "osa")
# Damerau-Levenshtein
stringdist("hello", "hallo", method = "dl")
# Longest common substring
stringdist("hello", "hallo", method = "lcs")
# q-gram
stringdist("hello", "hallo", method = "qgram", q = 2)
# Cosine
stringdist("hello", "hallo", method = "cosine", q = 2)
# Jaccard
stringdist("hello", "hallo", method = "jaccard", q = 2)
# Jaro
stringdist("hello", "hallo", method = "jw")
# Jaro-Winkler
stringdist("hello", "hallo", method = "jw", p = 0.1)
# Soundex
stringdist("hello", "hallo", method = "soundex")
```
## Distance Matrix
```r
# Compute distance matrix
strings <- c("hello", "hallo", "hullo", "world")
stringdistmatrix(strings)
# Between two sets
stringdistmatrix(c("hello", "world"), c("hallo", "word"))
```
## Approximate Matching
```r
# Find closest match
amatch("hello", c("hallo", "world", "help"), maxDist = 2)
# All matches within distance
ain("hello", c("hallo", "world", "help"), maxDist = 2)
```
## String Grouping
```r
# Group similar strings
strings <- c("hello", "hallo", "hullo", "world", "word")
stringdist_grouping <- function(x, maxDist = 2) {
d <- stringdistmatrix(x)
hc <- hclust(as.dist(d))
cutree(hc, h = maxDist)
}
```
## Phonetic Coding
```r
# Soundex
phonetic("hello", method = "soundex")
# Metaphone
phonetic("hello", method = "metaphone")
```
## Q-grams
```r
# Get q-grams
qgrams("hello", q = 2)
# Q-gram table
qgrams(c("hello", "world"), q = 2)
```
## Sequence Alignment
```r
# Get alignment
seq_dist("hello", "hallo", method = "lv")
seq_distmatrix(c("hello", "world"), c("hallo", "word"))
```
No comments yet. Be the first to comment!
This skill helps you track, analyze, and report on keyword ranking positions over time. It monitors both traditional SERP rankings and AI/GEO visibility to provide comprehensive search performance insights.
Find and analyze YouTube competitor channels using YouTube Data API v3. Discover competitors through keyword search, category matching, content similarity, and related channel discovery. Compare metrics, content strategies, and market positioning. Use when users want to (1) Find competitors for their YouTube channel, (2) Analyze competitor performance metrics, (3) Compare their channel against competitors, (4) Identify content gaps and opportunities, (5) Benchmark against similar creators, (6...
Get current weather and forecasts (no API key required).
Focused Signals scout for PostHog projects using revenue analytics. Watches the derived revenue product for upstream failures (Stripe sync stalls, capture regressions), config drift (missing subscription property, currency mix surprises, broken Stripe↔person joins, deferred-revenue gaps), and goal-miss escalations. Emits findings only when they clear the confidence bar; otherwise writes durable memory and closes out empty. Self-contained peer in the signals-scout-* fleet — no dependencies on ...
Focused Signals scout for finding observability gaps in PostHog itself — significant event volumes the team isn't tracking, custom events with no insight or dashboard coverage, insights pointing at events that have stopped firing, dashboards missing related context, critical events with no alerts. Watches the event-stream-vs-saved- inventory delta as the team's product evolves and emits findings recommending new insights, dashboard additions, or alerts when gaps clear the confidence bar. Self...