From hadley at rice.edu  Thu Mar 31 17:30:13 2011
From: hadley at rice.edu (Hadley Wickham)
Date: Thu, 31 Mar 2011 10:30:13 -0500
Subject: [Rd] Bug in as.data.frame.POSIXct?
Message-ID: <AANLkTimtW4Tu-q06TYsh2NAUW_eiuVsnAY_xZUL5Gqgj@mail.gmail.com>

> a <- as.POSIXct(1:2, origin="2011-01-01")
> dim(a) <- c(1, 2)
> as.data.frame(a)
                    a
1 2011-01-01 00:00:01
2 2011-01-01 00:00:02
>
> dim(a) <- c(2, 1)
> as.data.frame(a)
                    a
1 2011-01-01 00:00:01
2 2011-01-01 00:00:02

I think this is because in as.data.frame.POSIXct we have

  nrows <- length(x)

instead of

  nrows <- NROW(x)

Hadley


-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



[Rd] Bug in as.data.frame.POSIXct?
Hadley Wickham