设为首页收藏本站获取积分奖励

R语言中文网

 找回密码
 立即注册
查看: 969|回复: 0

R语言近似字符串匹配(模糊匹配)agrepl()函数-中英文对照帮助文档

[复制链接]
发表于 2020-8-20 22:39:50 | 显示全部楼层 |阅读模式
        R语言近似字符串匹配(模糊匹配)agrepl()函数-中英文对照帮助文档

                                         By MicroRbt Martinez PhD

R语言函数名:agrepl()
R语言函数功能:近似字符串匹配(模糊匹配)
来自资源库:基础库(R语言自带)
agrepl()函数所属R语言包:所在R包具体名称、包功能的中英文双语描述见正文后面'--所在R语言包信息--'部分。

描述-----Description-----

Searches for approximate matches to pattern (the first argument) within each element of the string x (the second argument) using the generalized Levenshtein edit distance (the minimal possibly weighted number of insertions, deletions and substitutions needed to transform one string into another).
使用广义Levenshtein编辑距离(将一个字符串转换为另一个字符串所需的最小加权插入,删除和替换次数),在字符串x(第二个参数)的每个元素内搜索与pattern(第一个参数)的近似匹配。


使用方法-----Usage-----

agrep(pattern, x, max.distance = 0.1, costs = NULL,
ignore.case = FALSE, value = FALSE, fixed = TRUE,
useBytes = FALSE)
agrepl(pattern, x, max.distance = 0.1, costs = NULL,
ignore.case = FALSE, fixed = TRUE, useBytes = FALSE)

参数-----Arguments-----

参数pattern介绍: a non-empty character string or a character string containing a regular expression (for fixed = FALSE) to be matched. Coerced by as.character to a string if possible.
非空字符串或包含要匹配的正则表达式的字符串(对于fixed = FALSE)。如果可能,将as.character强制转换为字符串。

参数x介绍: character vector where matches are sought. Coerced by as.character to a character vector if possible.
寻求匹配的字符向量。如果可能,由as.character强制为字符向量。

参数max.distance介绍: Maximum distance allowed for a match. Expressed either as integer, or as a fraction of the pattern length times the maximal transformation cost (will be replaced by the smallest integer not less than the corresponding fraction), or a list with possible components
比赛允许的最大距离。用整数或pattern长度乘以最大转换成本的分数表示(将由不小于相应分数的最小整数表示),或带有可能成分的列表


maximum number/fraction of match cost (generalized Levenshtein distance)
匹配费用的最大数量/分数(通用Levenshtein距离)


-----未完,待续-----,↓↓↓展开剩余72%↓↓↓
购买主题 前行需要您的支持,请赞助作者 【15 金钱】 就能浏览全部100%内容啦!(本贴一次赞助、永久可读)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|R语言中文网    

GMT+8, 2024-5-21 03:33 , Processed in 0.026190 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表