R语言统计数字频率
pi<- "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823"
str<-strsplit(pi,"")
print(unlist(str)[-2]);
str<-unlist(str)[-2][1:100]
result<-aggregate(str,list(str),length)
result<-result[order(result[,1],decreasing=T),]
print(result);
Group.1 x
10 9 13
3 2 12
4 3 12
9 8 12
5 4 10
7 6 9
1 0 8
2 1 8
6 5 8
8 7 8