[Rd] as.POSIXlt.factor and '...'

Joshua Ulrich josh.m.ulrich at gmail.com
Wed Dec 29 20:21:26 CET 2010


I noticed a difference in how as.POSIXct handled the 'format' argument
when 'x' is character versus when 'x' is a factor.  For example:

myFormat <- "%d-%m-%Y"
myDateStr <- format(Sys.Date()+1:5,myFormat)
as.POSIXct(myDateStr, format=myFormat)
as.POSIXct(factor(myDateStr), format=myFormat)

It seems to be caused by '...' not being passed in as.POSIXlt.factor.
Would it make sense to change the function to pass '...'?  I.e. from:
as.POSIXlt.factor <- function(x, ...) as.POSIXlt(as.character(x))
to:
as.POSIXlt.factor <- function(x, ...) as.POSIXlt(as.character(x), ...)

Regards,
--
Joshua Ulrich  |  FOSS Trading: www.fosstrading.com



More information about the R-devel mailing list