[R-sig-Geo] dates

Gabor Grothendieck ggrothendieck at gmail.com
Sun Jul 25 01:34:59 CEST 2010


On Sat, Jul 24, 2010 at 7:21 PM, Peter Larson <pslarson2 at gmail.com> wrote:
> Hi,
>
> This is completely unrelated to spatial anything (well, ostensibly) but I am
> trying the following to convert a string to a date and am getting nothing"
>
> dates <- c("27-Feb-92")
> as.Date(dates,format= '%d-%b-%y')
> [1] NA
>
> Any ideas?
>
> Thanks and sorry for the off topic issue.
>

google for r-help to find the list for general questions.

At any rate this is just a guess, but it may be that you are working
in a non-English locale so that Feb is not the short form for
February.

Try this to find out what it thinks is Feb should be written as:

   format(as.Date("1992-02-27"), "%d-%b-%Y")

If this is the problem see help(Sys.setlocale)



More information about the R-sig-Geo mailing list