[R] String frequencies in rows

Ben Bolker bolker at ufl.edu
Wed Jul 26 16:59:35 CEST 2006


Mario Falchi <mariofalchi <at> yahoo.com> writes:

> I’m trying to evaluate the frequency of different strings in each row of a
data.frame :
> INPUT:
> ID G1 G2 G3 G4 … GN
> 1 AA BB AB AB … 

  Something like

z <- data[,-1]
table(z,row(z))

  ?

  Ben Bolker



More information about the R-help mailing list