[R] matching items in a data frame

Lee Averell Lee.Averell at newcastle.edu.au
Wed Jul 6 07:41:57 CEST 2011

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?

More information about the R-help mailing list