Counts elements which meet specified conditions
计数符合指定条件的元素,
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Count the number of times the values in the vector meet the specified conditions.
向量中的值满足指定的条件的次数计数。
用法----------Usage----------
count(x)
参数----------Arguments----------
参数:x
Vector and condition to count.
向量和条件来计算。
参见----------See Also----------
length, nchar
长度,NCHAR
实例----------Examples----------
set.seed(1)
x <- rnorm(100)
# Count the number of times the values in x are greater then 0[在x的值大于0的次数计数]
count( x>0 )
# Count the number of times the values in x are within the 95% confidence interval[计数的次数,在x的值是在95%的置信区间内的]
count( (x>-1.96) & (x<1.96) )
# Or could have used[或者,也可以使用]
count( abs(x)<1.96 )
# Count the number of times the values in x are the same as the first element[在x的值作为第一个元素是相同的次数计数]
count( x==x[1] )