Hi R helpers! I have the following dataframe ?choose? choose<-data.frame(firm=c(1,1,2,2,2,2,3,3,4,4,4,4,4,4), year=c(2000,2001,2000,2001,2002,2003,2000,2003,2001,2002,2003,2004,2005,2006),code=c(10,10,11,11,11,11,12,12,13,13,13,13,13,13)) choose I want to subset it to obtain another one with those observations for which there more than 2 observations in the column ?code?. So I want a dataframe ?chosen? like this: chosen<-data.frame(firm=c(2,2,2,2,4,4,4,4,4,4),year=c(2000,2001,2002,2003,2001,2002,2003,2004,2005,2006),code=c(11,11,11,11,13,13,13,13,13,13)) chosen I?ve tried split() and then nrow() but I got nothing. Could anyone help me with this? Thanks Cec?lia (Universidade de Aveiro ? Portugal)
subset dataframe by number of rows of equal values
2 messages · Cecilia Carmo, jim holtman
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090524/cf49fbeb/attachment-0001.pl>