Your dates have an incomplete year information with 34. R assumes that 00-68 
are 2000 to 2068 and 69 to 99 are 1969 to 1999. See ?strptime and the details 
for %y. 

You can either append ā€œ19ā€ to the start of your year variable to make it 
completely express the year or check if the date is in the future (assuming all 
dates should be in the past) and subtract 100 years from the date. 


> On Dec 28, 2017, at 11:13 AM, Ramesh YAPALPARVI 
> <ramesh.yapalpa...@icloud.com> wrote:
> 
> Hi all,
> 
> Iā€™m struggling to get the dates in proper format.
> I have dates as factors and is in the form 02/27/34( 34 means 1934). If I use
> 
> as.Date with format %d%m%y it gets converted to 2034-02-27. I tried changing 
> the origin in the as.Date command but nothing worked. Any help is appreciated.
> 
> Thanks,
> Ramesh
> ______________________________________________
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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