Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How to split colums into multiple colums and find frequency in R?

$
0
0

ODK response

1
1; 2
1; 2; 3
1; 2; 3; 5
1; 2; 4
1; 2; 4; 5; 6
1; 2; 4; 6
1; 2; 4; 7

1 is Crop failure-
2 is Water shortage
3 is Land degradation
4 is Lack of HH Labor
5 is Lack of income from agriculture
6 is Lack of manure / fertilizer
7 is Others

I would like to get a table like this

Crop failure- 8
Water shortage- 7
Land degradation- 6
Lack of HH Labor- 1
Lack of income from agriculture- 2
Lack of manure / fertilizer- 2
Others- 1

I have tried in 'Split single column with multiple values into multiple colums' using dplyr in R but couldn't please help.


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>