我有一个看起来像的 data.frame
a = c("sample1", "asd")
b = c("sample2" ,"poua")
c = c("sample3", "asd")
dat <- rbind(a,b,c)
我想计算 column2 字符串频率,并将 column1 名称保留在列表/参差不齐的计数数组中。即让它看起来像
asd sample1 sample3
poua sample2
我知道表计数频率,但我无法让它保留名称,所以我真的非常感谢任何帮助!