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
[EMAIL PROTECTED]
[EMAIL PROTECTED] 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.
>
> ______________________________________________
> [email protected] 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.
______________________________________________
[email protected] 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.