我有一个位置向量,我试图消除与正确位置名称向量的歧义。对于这个例子,我只使用了两个明确的位置:
agrepl('Au', c("Austin, TX", "Houston, TX"),
max.distance = .000000001,
ignore.case = T, fixed = T)
[1] TRUE TRUE
帮助页面说max.distance
是
一场比赛允许的最大距离。表示为整数或模式长度乘以最大转换成本的分数
我不确定Levensthein距离的数学含义;我的理解是,距离越小,与我的歧义字符串向量不匹配的容忍度就越严格。
所以我会调整它以检索两个FALSE
?基本上,我TRUE
只想在有 1 个字符的差异时使用,例如:
agrepl('Austn, TX', "Austin, TX",
max.distance = .000000001, ignore.case = T, fixed = T)
[1] TRUE