[R] frequency of items

Michael Dewey lists at dewey.myzen.co.uk
Wed Jul 20 10:55:43 CEST 2016


It seems very unlikely that what you quote can be a data frame. It could 
be a list I suppose. Can you clarify?

On 19/07/2016 11:59, sri vathsan wrote:
> Hi,
>
> I have a data frame like below.
> 11,15,12,25
> 11,12
> 15,25
> 134,45,56
> 46
> 45,56
> 15,12
> 66,45,56,24,14,11,25,12,134
>
> I want to identify the frequency of pairs/triplets or higher that occurs in
> the data. Say for example, in above data the occurrence of pairs looks like
> below
>
> item     No of occurrence
> 11,12         3
> 11,25         2
> 15,12         2
> 15,25         2
> .
> .
> 45,56          3
> 134,45,56    2
>
>  ....and so on
>
> I am trying to write R code for the above and I am finding difficulty to
> approach this. Looking forward some help.
>
> Thanks!
>

-- 
Michael
http://www.dewey.myzen.co.uk/home.html



More information about the R-help mailing list