[R] Manipulating dates

james.holtman@convergys.com james.holtman at convergys.com
Tue Jun 14 16:14:41 CEST 2005





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 at convergys.com
+1 (513) 723-2929


                                                                                                                                           
                      Richard Hillary                                                                                                      
                      <r.hillary at imperial.a        To:       r-help at stat.math.ethz.ch                                                      
                      c.uk>                        cc:                                                                                     
                      Sent by:                     Subject:  [R] Manipulating dates                                                        
                      r-help-bounces at 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 at 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




More information about the R-help mailing list