[R] word frequency count

mail me mailme842 at googlemail.com
Sun Mar 18 12:12:48 CET 2012


Hi:

I have a dataframe containing comma seperated group of words such as

milk,bread
bread,butter
beer,diaper
beer,diaper
milk,bread
beer,diaper

I want to output the frequency of occurrence of comma separated words
for each row and collapse duplicate rows, to make the output as shown
in the following dataframe:

milk,bread   2
bread,butter 1
beer,diaper  3
milk,bread   2

Thanks for help!

deb



More information about the R-help mailing list