Skip to content

aggredating date data

4 messages · analyst41 at hotmail.com, Jannis, Gene Leynes +1 more

#
I tried a date by date forecast of a time series and it seems to be
too wild.  How can I aggregate the date into weeks or months as
required?

Thanks.

The input looks like

ID datadate("YYYY-MM-DD")  value_for_day
--     -----                                -------
--     ------                               --------

and I want to be able to change it to

ID dataweek value_for_week

or

ID datamonth value_ for_ month
#
?aggregate

I would transfer your date character sting into a date object (as.POSIXct) and then extract month or week numbers (?format) from this vector and use them as indices for the aggregate function. There may be more elegant ways though....


HTH
Jannis

--- analyst41 at hotmail.com <analyst41 at hotmail.com> schrieb am Mi, 12.1.2011:
#
On Wed, Jan 12, 2011 at 7:35 PM, Gene Leynes <gleynes+r at gmail.com> wrote:
Also note the existence of read.zoo and its aggregate= argument.