[R] zoo: merging aggregated zoo-objects fails

Gabor Grothendieck ggrothendieck at gmail.com
Mon Sep 28 15:06:54 CEST 2009


This looks like a problem in the chron package.  Define:

c.chron <- function(...) chron(do.call("c", lapply(list(...), unclass)))

and then try it again.  I will discuss it with the chron maintainer.

On Mon, Sep 28, 2009 at 6:41 AM, gunnar.p <pruss at uni-potsdam.de> wrote:
>
> Hello Gabor,
> thanks for your reply. Please excuse the insufficient description of my
> problem. I hope this one is better:
>
> #Importing my data works basically like this
> dts <-
> dates(c("19700201","19700201","19700201","19700202","19700202"),format="ymd")
> tms <- times(paste(c("21:00", "22:00", "23:00","00:00",
> "01:00"),0,sep=":"),format="h:m:s")
> x   <- chron(dates=dts,times=tms)
> z   <- zoo(c(174.055,174.067,174.076,174.085,174.091),x)
> #Because I need daily values I run:
> z   <- aggregate(z,trunc,mean)
> #And because I deal with different data sets and need to sum them up I run:
> m   <- merge(z,z)
>
> When R executes merge() I get the following error message:
> "Fehler in matrix(unlist(lapply(dots, origin)), nrow = 3) : Versuch ein
> Attribut von NULL zu setzen"
> (Sorry that it's German. It says something like 'Error... Try to set
> attribute NULL')
> It's curious that there is no error when I first run merge() and than
> aggregate(), but this is not possible
> due to the rest of the programm.
> So why is merging not possible?
>
> Thanks in advance,
> gunnar
> R version 2.9.1 (Debian Lenny, XFCE 4.4, EMACS 22.2.1, ESS 5.3.8)
> --
> View this message in context: http://www.nabble.com/zoo%3A-merging-aggregated-zoo-objects-fails-tp25633345p25643639.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>




More information about the R-help mailing list