R.加上引号

时间:2016-12-07 15:32:53

标签: r

napis <- paste0("Ala","Ma","Kota","Tomek","ma","psa")
a6=length((table(strsplit(napis, ""))))
print(a6)#A
#b
c=max(table(unlist(strsplit(napis, ""))))
print(c)
print((which.max(c))) 

上次打印展示价值= 5

我想要显示哪些字母出现5次(它&#39; s&#34; a&#34;)我希望将其显示为&#34; a&#34;

1 个答案:

答案 0 :(得分:1)

试试这个,

names(which.max(table(unlist(strsplit(napis, "")))))
#[1] "a"