Re: [R] Manipulating dates

From: Dimitris Rizopoulos <dimitris.rizopoulos_at_med.kuleuven.be>
Date: Wed 15 Jun 2005 - 00:18:52 EST

try this:

x <- c("28/03/2000", "27/08/2001", "29/05/2002", "15/12/2003") y <- as.Date(x, "%d/%m/%Y")
y - min(y)

I hope it helps.

Best,
Dimitris



Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium

Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


> 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:22:28 2005

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