Hi all,

It's my first post on r-devel, I saw on SO that it the best way to notify small 
bugs/potential improvements.

It seems that it would be nice to be able to pass the classic conversion 
arguments (like the time zone "tz = ...") to the internal .POSIXct() when 
calling as.POSIXct.Date() :

> str(date)
 Date[1:1], format: "2007-01-01"
> as.POSIXct(date, tz="UTC")
[1] "2006-12-31 16:00:00 PST"
> .POSIXct(as.numeric(date)*86400, tz="UTC")
[1] "2007-01-01 UTC"

I would just add three small dots to the definition of the function:
> as.POSIXct.Date
function (x, ...)
.POSIXct(unclass(x) * 86400, ...)
<bytecode: 0xa1c72a0>
<environment: namespace:base>

Or maybe directly passing only the arguments we are interested in (like tz) :

> as.POSIXct.Date
function (x, tz ="", ...)
.POSIXct(unclass(x) * 86400, tz)
<bytecode: 0xa1c72a0>
<environment: namespace:base>

Is there a reason why it doesn't do it ? I may have overlooked something.

Thanks,
Antoine Lizee

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to