igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Help !!!


From: Gábor Csárdi
Subject: Re: [igraph] Help !!!
Date: Fri, 2 Jan 2009 10:51:33 +0100

If your table is named 'data' and your columns are named 'V1', 'V2'
and 'V3', then you can do

aggregate(data$V3, list(data$V1, data$V2), mean)

Gabor

ps. yes, please post these kind of questions to R-help, you will get
MUCH quicker and better answers.

ps2. please choose a better subject next time, the mailing list
archive is more useful if people use appropriate subject lines.

On Fri, Jan 2, 2009 at 7:19 AM, lan gao <address@hidden> wrote:
> Dear all,
> I know I may need to ask the R help group, but it would be great if anyone
> here can help me out this the following questions:
>
> I have a data set like this , three columns ,I need to combine the rows with
>  the col1 and col2 are exaclty the same then average the col3
>
>
> YAL003W
> GO:0003746
> 8.273667
> YAL003W
> GO:0003746
> 8.991333
> YAL005C
> GO:0000166
> 13.679
> YAL005C
> GO:0000166
> 13.89867
> YAL005C
> GO:0000166
> 10.169
> For the above sample data, I want to combine the first 2 rows and average
> their corresponding col1 to col2 ...then combine the row3 to row5....average
> col3-clo5
>
>
> the final data set would be like
> YAL003W    GO:0003746       8.6325
> YAL005C     GO:0000166       12.5822
>
> Many thanks!!!
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]