Hi everyone,

I am trying to use the function as.date() from the "dates" package in R
2.10.0 to convert a character date to a Julian date, as follows:

> as.date("02-MAY-01", order="mdy") # convert May 2, 2001 to a Julian date
[1] 2May1

However, when trying to convert a character date from the year 2000 to a
Julian date, I get an <NA> instead of the
desired Julian date:

> as.date("02-MAY-00", order="mdy") # convert May 2, 2000 to a Julian date
[1] <NA>

Not quite sure why R is unable to handle this type of date (perhaps it
thinks it comes from the year 1900?!).

Is there a way to force R to convert character dates from the year 2000 into
Julian dates?  I need to
perform this conversion in order to compute the difference between two
dates, one of which happens to come
from the year 2000.

Many thanks!

Isabella

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to