Skip to content
Back to formatted view

Raw Message

Message-ID: <1318527019853-3902286.post@n4.nabble.com>
Date: 2011-10-13T17:30:19Z
From: syrvn
Subject: Remove specific rows in a matrix/data.frame
In-Reply-To: <1318525489211-3902216.post@n4.nabble.com>

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.