我是 R 新手,对pos()
函数的工作方式感到困惑。原因如下:
例子:
library(qdap)
s1<-c("Hello World")
pos(s1)
这会产生正确的输出,说明字数
wrd.cnt - 2
NN -1(50%)
UH-1(50%)
而以下操作会引发错误:
s2<-"Hello"
pos(s2)
Error in apply(pro, 2, paster, digits = digits, symbol = s.ymb, override = override) :
dim(X) must have a positive length
s3<-c("Hello Hello")
pos(s3)
Error in apply(pro, 2, paster, digits = digits, symbol = s.ymb, override = override) :
dim(X) must have a positive length
我无法理解为什么会这样。