On Tue, Sep 27, 2011 at 5:23 AM, Agustin Lobo
<agustin.l...@ictja.csic.es> wrote:
> I have the following time series:
>
>> class(CCasadesz2)
> [1] "zoo"
>> setmanes <- cut(time(CCasadesz2),breaks="weeks")
>> CCasadeswz <- aggregate(CCasadesz2,sum,by=setmanes)

cut produces a "factor", not a "Date". The by= argument in
aggregate.zoo should not be a factor but rather should define the new
index. If you want the new index to be a "Date" class then by= should
define a "Date" vector.  See ?aggregate.zoo .

Try:

setmanes <- as.Date(format(setmanes))

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to