[R] Odp: number of days

From: Petr PIKAL <petr.pikal_at_precheza.cz>
Date: Mon, 14 May 2007 12:08:39 +0200


Hi

it will partly depend on which format of dates you use but usually it is as easy as

> dates <- c("02/27/92", "02/27/92", "01/14/92", "02/28/92", "02/01/92")
> ddd<-as.Date(dates, "%m/%d/%y")
> diff(ddd)

Time differences in days
[1] 0 -44 45 -27
> Sys.Date()-ddd

Time differences in days
[1] 5555 5555 5599 5554 5581
>

Regards

Petr
petr.pikal_at_precheza.cz

r-help-bounces_at_stat.math.ethz.ch napsal dne 14.05.2007 11:16:10:

>
> Hi, some of you knows how to calculate in R the number of days between
given
> dates?
> issue relevant in option pricing
> thanks, robert
> --
> View this message in context:
http://www.nabble.com/number-of-days-tf3751163.
> html#a10600371
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.



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 and provide commented, minimal, self-contained, reproducible code. Received on Mon 14 May 2007 - 10:34:06 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 14 May 2007 - 11:31:44 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.