R语言 获取矢量中的元素匹配 – charmatch()函数
R编程语言 中的charmatch()函数 ,用于寻找两个参数之间的匹配。
语法: charmatch(x, table, nomatch = NA_integer_)
参数
- x: 要匹配的值
- table: 要匹配的值
- nomatch: 在非匹配位置要返回的整数值
r – charmatch() 函数示例
例1 :
输出:
例2 :
输出
R编程语言 中的charmatch()函数 ,用于寻找两个参数之间的匹配。
语法: charmatch(x, table, nomatch = NA_integer_)
参数
例1 :
输出:
例2 :
输出