[R] Problems with rbind

Gabor Grothendieck ggrothendieck at gmail.com
Sat Nov 15 19:37:32 CET 2008


It also works for me using zoo 1.5-4 and R 2.7.2.  Try it running at the
beginning of a vanilla session.  If still a problem reinstall zoo:

install.packages("zoo", dep = TRUE)

If still a problem reinstall R and then reinstall zoo, preferable
going to R 2.8.0.

On Sat, Nov 15, 2008 at 12:19 PM, Dieter Menne
<dieter.menne at menne-biomed.de> wrote:
>
>
>
> TU wrote:
>>
>> A recent update on base packages on my R installation has introduced a
>> problem to my code which did not exist before the update. The offending
>> function is rbind, which fails where it was working just fine before the
>> update.
>>
>> I have two zoo objects, foo and bar, indexed by class Date. foo starts
>> from "2007-10-09" and bar from "2007-10-10". I attempt to pad bar with a
>> zero on Date "2007-10-09".
>>
>>
>
> Your example works for me:
>
>> library(zoo)
> Attaching package: 'zoo'
>        The following object(s) are masked from package:base :
>         as.Date.numeric
>
>> foo<-zoo(1,order.by=as.Date("2007-10-09"))
>> bar<-zoo(2,order.by=as.Date("2007-10-10"))
>> bar <- rbind(zoo(0, order.by = index(foo)[1]), bar)
>> bar
> 2007-10-09 2007-10-10
>         0          2
>
>> sessionInfo()
> R version 2.8.0 (2008-10-20)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252
>
> attached base packages:
> [1] stats     graphics  grDevices datasets  utils     methods   base
>
> other attached packages:
> [1] zoo_1.5-4
>
> loaded via a namespace (and not attached):
> [1] grid_2.8.0      lattice_0.17-15 tools_2.8.0
>
>
> --
> View this message in context: http://www.nabble.com/Problems-with-rbind-tp20516377p20517592.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