Re: [R] Manipulating dates

From: <james.holtman_at_convergys.com>
Date: Wed 15 Jun 2005 - 00:14:41 EST

Use POSIX. To convert:

my.dates <- strptime(your.characters, format='%d/%m/%Y')

once you have that, you can use 'min' to find the minimum.

'difftime' will give you the differences.

Jim



James Holtman "What is the problem you are trying to solve?" Executive Technical Consultant -- Convergys Labs james.holtman@convergys.com
+1 (513) 723-2929
                                                                                                                                           
                      Richard Hillary                                                                                                      
                      <r.hillary@imperial.a        To:       r-help@stat.math.ethz.ch                                                      
                      c.uk>                        cc:                                                                                     
                      Sent by:                     Subject:  [R] Manipulating dates                                                        
                      r-help-bounces@stat.m                                                                                                
                      ath.ethz.ch                                                                                                          
                                                                                                                                           
                                                                                                                                           
                      06/14/2005 10:07                                                                                                     
                      Please respond to                                                                                                    
                      r.hillary                                                                                                            
                                                                                                                                           




Hello,
          Given a vector of characters, or factors, denoting the date in
the following way: 28/03/2000, is there a method of 1) Computing the earliest of these dates; 2) Using this as a base, then converting all the other dates into merely the number of days after this minimum date Many thanks
Richard Hillary

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jun 15 00:18:37 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:34 EST