TABLATE获取整数值向量bin,并计算每个整数在其中出现的次数。
tabulate(bin, nbins = max(1, bin, na.rm = TRUE))
bin : (正整数的)数字向量,或因子。长支持向量。
nbins : 要使用的箱子数。
tabulate(c(2,3,5))
tabulate(c(2,3,3,5), nbins = 10)
tabulate(c(-2,0,2,3,3,5)) # -2 and 0 are ignored
tabulate(c(-2,0,2,3,3,5), nbins = 3)
tabulate(factor(letters[1:10]))