From p.dalgaard at biostat.ku.dk  Tue Sep  7 00:17:21 2004
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Tue Sep  7 00:17:47 2004
Subject: [Rd] Glitch involving difftime and data frame
Message-ID: <x2llfn2gb2.fsf@biostat.ku.dk>

This looks unintentional:

> d <- as.Date("2004-09-07")
> dd <- as.Date("2004-10-04")
> data.frame(d,dd,dd-d)
Error in as.data.frame.default(x[[i]], optional = TRUE) :
        can't coerce difftime into a data.frame
> F <- data.frame(d,dd)
> F$foo <- dd-d
> cbind(F,dd-d)
Error in as.data.frame.default(x[[i]], optional = TRUE) :
        can't coerce difftime into a data.frame

Basically, the issue is that as.data.frame on a classed object expects
to find a method and there isn't any for difftime...


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] Glitch involving difftime and data frame
Peter Dalgaard