Domanda

Like the title says,

>as.Date("06/10/2013", "%m/%d/%y") # returns "2020-06-2013
[1] "2020-06-10"

What is causing this? I'm using windows with 32-bit RGui and the latest zoo package.

Thanks.

È stato utile?

Soluzione

Because %y is not %Y:

R> as.Date("06/10/2013", "%m/%d/%Y")   # note capital-Y
[1] "2013-06-10"
R> 
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top