بنقرة واحدة
stringdist
R stringdist package for string distance. Use for approximate string matching and distance metrics.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
R stringdist package for string distance. Use for approximate string matching and distance metrics.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
R language data analysis and visualization skill. Use when user asks to (1) run R scripts or code, (2) install/update R packages, (3) perform data analysis with R, (4) create visualizations with ggplot2/plotly, (5) statistical analysis, (6) data manipulation with tidyverse/dplyr/data.table. Triggers on keywords like "R语言", "R脚本", "ggplot", "tidyverse", "数据分析", "可视化".
R DALEX package for model explanations. Use for explaining complex machine learning models.
R iml package for interpretable ML. Use for model-agnostic interpretability methods.
R lime package for local explanations. Use for explaining individual predictions with local interpretable models.
R packages for ML interpretability. Use for explaining and interpreting machine learning models.
R vip package for variable importance. Use for computing and visualizing variable importance scores.
| name | stringdist |
| description | R stringdist package for string distance. Use for approximate string matching and distance metrics. |
Approximate string matching and string distance functions.
library(stringdist)
# Single comparison
stringdist("hello", "hallo")
# Multiple comparisons
stringdist(c("hello", "world"), c("hallo", "word"))
# 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")
# Compute distance matrix
strings <- c("hello", "hallo", "hullo", "world")
stringdistmatrix(strings)
# Between two sets
stringdistmatrix(c("hello", "world"), c("hallo", "word"))
# Find closest match
amatch("hello", c("hallo", "world", "help"), maxDist = 2)
# All matches within distance
ain("hello", c("hallo", "world", "help"), maxDist = 2)
# 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)
}
# Soundex
phonetic("hello", method = "soundex")
# Metaphone
phonetic("hello", method = "metaphone")
# Get q-grams
qgrams("hello", q = 2)
# Q-gram table
qgrams(c("hello", "world"), q = 2)
# Get alignment
seq_dist("hello", "hallo", method = "lv")
seq_distmatrix(c("hello", "world"), c("hallo", "word"))