【发布时间】:2016-04-22 14:10:45
【问题描述】:
我有一些来自民意调查的数据,如下所示:
Freetime_activities
1 Travelling, On the PC, Clubbing
2 Sports, On the PC, Clubbing
3 Clubbing
4 On the PC
5 Travelling, On the PC, Clubbing
6 On the PC
7 Watching TV, Travelling
我想获取每个值的计数(旅行多少次/在 PC 上等),但我无法拆分这些值。 R中是否有一个函数可以做例如:
split("A,B,C") ->
1 A
2 B
3 C
或者是否有直接从列中计算值的直接解决方案?
【问题讨论】: