[R] unexpected behaviour of rbind with dataframe containing POSIXct

Alexander Senger senger at physik.hu-berlin.de
Fri Nov 12 18:57:06 CET 2010

Hello list,

here is what I stumbled upon:

1> test <- data.frame(time=as.POSIXct((1:2),origin="2000-1-1"))
1> test
1 2000-01-01 00:00:01
2 2000-01-01 00:00:02
1> rbind(test,b=1:2)
Fehler in as.POSIXct.numeric(value) : 'origin' muss angegeben werden

When I try to attach an additional row to a dataframe with a row
containing dates I get the error shown above (which says that there was
an error in "as.POSIXct.numeric(value)": an 'origin' has to be given).

I haven't found any information on this so I would like to know whether
this is to be regarded as a bug and be properly reported.

This is my sessionInfo:

1> sessionInfo()
R version 2.10.1 (2009-12-14)

 [1] LC_CTYPE=de_DE.utf8       LC_NUMERIC=C
 [3] LC_TIME=de_DE.utf8        LC_COLLATE=de_DE.utf8
 [5] LC_MONETARY=C             LC_MESSAGES=de_DE.utf8
 [7] LC_PAPER=de_DE.utf8       LC_NAME=C
 [9] LC_ADDRESS=C              LC_TELEPHONE=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_2.10.1

I'm aware that my version is somewhat outdated but it seems not much has
changed with rbind() since then. Please correct me if I'm wrong.

Thank you for your attention


More information about the R-help mailing list