Develop Actuarial Models

Actuarial reports are prepared for the last day of a specific period, such as a month, a quarter or a year. Actuarial models assume that certain events happen at the beginning or end of periods. The package contains functions to easily refer to the first or last (working) day within a specific period relative to a base date to facilitate actuarial reporting and to compare results.


actuaryr

Travis buildstatus

The goal of actuary package is to support the actuarial modelling.

You can install actuaryr package with:

library(actuaryr)

Date reference functions

Retrieve the date in reference to the base date.

Build a function using dref_ + first letters of the reference day.

of month of quarter of year
first day dref_fdom() dref_fdoq() dref_fdoy()
first working day dref_fwdom() dref_fwdoq() dref_fwdoy()
last day dref_ldom() dref_ldoq() dref_ldoy()
last working day dref_lwdom() dref_lwdoq() dref_lwdoy()

Examples:

dref_fdom("2019-09-21")
#> [1] "2019-09-01"
dref_fwdoq("2019-09-21")
#> [1] "2019-07-01"
dref_ldoy("2019-09-21")
#> [1] "2019-12-31"
dref_lwdom("2019-09-21")
#> [1] "2019-09-30"

Compare

Compare two tables with compare().

x <- data.frame(
  v1 = 1:3,
  v2 = 4:6
)
y <- data.frame(
  v1 = 1:3,
  v2 = 7:9
)
compare(x, y)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("actuaryr")

1.1.1 by Zuzanna Chmielewska, 7 years ago


Browse source code at https://github.com/cran/actuaryr


Authors: Zuzanna Chmielewska [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports lubridate, dplyr, magrittr, crayon, purrr, tibble

Suggests testthat, knitr, rmarkdown


See at CRAN