Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

[R] Odp: number of days

Petr Pikal

2007-05-14

Replies:

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@(protected)

r-help-bounces@(protected):

>
> 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@(protected)
> 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@(protected)
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.
©2008 r-help.com - Jax Systems, LLC, U.S.A.