Re: [R] as.Date function error

2011-04-17 Thread Achim Zeileis
On Sun, 17 Apr 2011, Wonjae Lee 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? You used %y (two-digit year, here: "20" and then expanded to "2020") instead of %Y (four-digit year, here "2010").

Re: [R] as.Date function error

2011-04-17 Thread Dennis Murphy
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 wrote: > Hi, > > I have some problems with as.Date function. > After I applied as.Date for my data, "2010" changed to "2020" as below

[R] as.Date function error

2011-04-17 Thread Wonjae Lee
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"