Hello again, dtf<-read.table(textConnection("Letter Test Number a b 1 a b 1 b b 1 b b 0 c b 0 c b 1 d b 0 d b 0"),header=T) aggregate(Number ~ Letter,data=dtf,max)
how can I adjust this solution that the results also includes "Test"? I tried: aggregate(Number ~ Letter,data=dtf,max,by=list("Letter", "Test", "Number")) But it breaks with the following error message: Error in aggregate.data.frame(mf[1L], mf[-1L], FUN = FUN, ...) : arguments must have same length -- View this message in context: http://r.789695.n4.nabble.com/Remove-specific-rows-in-a-matrix-data-frame-tp3902149p3902286.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@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.