Re: [R] as.Date function error

From: Dennis Murphy <djmuser_at_gmail.com>
Date: Sun, 17 Apr 2011 14:05:18 -0700

as.Date(x,"%m/%d/%Y")
[1] "2010-11-16" "2010-11-17" "2010-11-18" "2010-11-19"

Notice the Y (four digit date).

Dennis

On Sun, Apr 17, 2011 at 6:34 AM, Wonjae Lee <wjlee2002_at_naver.com> wrote:
> Hi,
>
> I have some problems with as.Date function.
> After I applied as.Date for my data, "2010" changed to "2020" as below
> Where am I wrong?
>
> Thanks
>
> Wonjae
>
>> x=c("11/16/2010","11/17/2010","11/18/2010","11/19/2010")
>> x=as.Date(x,"%m/%d/%y")
>> x
> [1] "2020-11-16" "2020-11-17" "2020-11-18" "2020-11-19"
>
> my R veision is 2.12.2.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/as-Date-function-error-tp3455466p3455466.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_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.
>



R-help_at_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. Received on Sun 17 Apr 2011 - 21:11:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 17 Apr 2011 - 21:20:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive