Skip to content

Calculate of data frame

1 message · Zhang, Fan

#
Thanks for your answer, Peter. Now I have a new data frame which is sorted by (model,date) pair. Since the sorting is done to charactors, I have 7/1/2005 followed by 7/10/2005 instead of 7/2/2005. How can I do the aggregation and at the same time, make the result sorted the way I want (i.e, 7/1/2005 followd by 7/2/2005)? 

Thanks,

Fan
-----Original Message-----
From: pd at pubhealth.ku.dk [mailto:pd at pubhealth.ku.dk] On Behalf Of Peter Dalgaard
Sent: Thursday, July 14, 2005 1:29 PM
To: Zhang, Fan
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] Calculate of data frame

"Zhang, Fan" <fzhang at doubleclick.net> writes:
date model count value
1 7/1/2005     A     6  31.8
2 7/2/2005     A     3  10.2
3 7/1/2005     B     7  14.2
4 7/2/2005     B    10  71.4