[R] matching items in a data frame

Jim Holtman jholtman at gmail.com
Wed Jul 6 12:25:27 CEST 2011


table(dat$word)

Sent from my iPad

On Jul 6, 2011, at 1:41, Lee Averell <Lee.Averell at newcastle.edu.au> wrote:

> I have a data frame with 2 columns, the first is an index of participants and the second is a list of words presented to the participant (see below).
> 
>> head(dat)
>     s    word
> 1a pianist
> 1a   sweat
> 1a carnage
> 1a   nymph
> 1a    hank
> 1a   waist
> 
>> tail(dat)
>        s    word
> 4a package
> 4a   blink
> 4a  orange
> 4a bedroom
> 4a    curb
> 4a    bowl
> 
> Some of the words are presented to multiple participants others are not. I am trying to get an index of 1) which words are repeated and  2) how many times they are repeated. Any suggestions?
> Lee
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list