[R-sig-ins] mondate version 0.9.10.04 now on CRAN

Dan Murphy chiefmurphy at gmail.com
Mon Feb 11 14:15:14 CET 2013


To R-Sig-Insurance:

The mondate package enables date arithmetic in units of 'months' and
'years', not available with the base 'difftime' function. This can be
particularly helpful for calculating the actuarial age of
property/casualty/general insurance liabilities.

Update ...04 expands the signature of the year, month, and day
functions to Date and POSIXt data. See NEWS at
cran.r-project.org/web/packages/mondate/index.html.

An example of using mondate is
> library(mondate)
> mondate(as.Date("2013-03-31")) - mondate(as.Date("2013-02-28"))
[1] 1

A potential future package enhancement would be to extend 'difftime'
so that the following functionality is possible
> difftime(as.Date("2013-03-31"), as.Date("2013-02-28"), units = "months")
Time difference of 1 month

For more information on mondate, visit http://code.google.com/p/mondate/

Dan Murphy



More information about the R-SIG-insurance mailing list