Irina, you must have them in character format. You need to convert to Date type.
mydates = as.Date(mydates, "%m/%d/%Y") HTH. Horace -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Irina Burmenko Sent: Wednesday, November 28, 2007 11:44 AM To: Horace Tso; r-help@r-project.org Subject: [R] Dates in R Hi, I have dates in the following format: 4/8/2006 (MM/DD/YYYY). I need to have R compare date A to date B to figure out which one is more recent. Is there a way to do that? Simply using the '>' or '<' signs doesn't seem to work. I think in this case R treats '/' as a division sign and gives me erroneous results. Thanks a lot for your help. Irina ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. [[alternative HTML version deleted]] ______________________________________________ R-help@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@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.