tfire, TIBCO Software
> wdunlap tibco.com
>
>
>> -Original Message-
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
>> Behalf
>> Of arun
>> Sent: Thursday, February 21, 2013 1:45 PM
>> To: Johannes Brand
>> Cc: R
wdunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf
> Of arun
> Sent: Thursday, February 21, 2013 1:45 PM
> To: Johannes Brand
> Cc: R help
> Subject: Re: [R] remove rows in data frame by ave
another option that i think is easy & intuitive :)
library(sqldf)
mydata <- sqldf( "select Subject , Block , avg( Feature1 ) as Feature1 ,
avg( Feature2 ) as Feature2 , [..keep going..] , avg( Feature10 ) as
Feature10 from yourdata group by Subject , Block" )
On Thu, Feb 21, 2013 at 4:45 PM,
Hi,
May be this helps:
dat1<- read.table(text="
Subject Block Trial Feature1 Feature2
1 1 1 48 40
1 1 2 62 18
1 2 1 34 43
1 2 2 51 34
1 3 1 64 14
",sep="",header=TRUE)
res1<-do.call(rbind,lapply(split(dat1,dat1$Block),function(x)
data.frame(unique(x[,1:2]),t(colMeans(x[
4 matches
Mail list logo