Skip to content
Prev 11881 / 63421 Next

bug in ifelse (PR#6611)

This is already corrected in the current R-devel sources.

Note that this is an incorrect use of as.POSIXct: do read the 
description of the allowed formats:

     They can also
     convert character strings of the formats '"2001-02-03"' and
     '"2001/02/03"' optionally followed by white space and a time in
     the format '"14:52"' or '"14:52:03"'.  (Formats such as
     '"01/02/03"' are ambiguous but can be converted via a format
     specification by 'strptime'.)

and you are not getting the result I think you expected.

Finally, the result is not of class "POSIXct", which looks like an 
infelicity in ifelse.

aa <- as.POSIXct(c('1980/1/1','1980/1/2',''))
aaa <- aa
aaa[is.na(aa)] <-  as.POSIXct('1980/1/3') 

is probably what you wanted here.
On Tue, 24 Feb 2004 svetlana.eden@vanderbilt.edu wrote: