[R] Remove specific rows in a matrix/data.frame

syrvn mentor_ at gmx.net
Thu Oct 13 19:30:19 CEST 2011


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.



More information about the R-help mailing list