一、nchar函数介绍
nchar takes a character vector as an argument and returns a vector whose elements contain the sizes of the corresponding elements of x.
nchar的参数是一个字符向量,返回对应位置上字符串的长度
nzchar is a fast way to find out if elements of a character vector are non-empty strings.
用法
nchar(x, type = "chars", allowNA = FALSE, keepNA = NA)
nzchar(x, keepNA = FALSE)
例子
本文介绍了R语言中nchar和nzchar函数的基本用法及示例。nchar函数用于计算字符向量中各元素的长度,而nzchar则用于判断字符向量中的元素是否为空字符串。
1054

被折叠的 条评论
为什么被折叠?



