Learn R Programming

actuaryr

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 monthof quarterof year
first daydref_fdom()dref_fdoq()dref_fdoy()
first working daydref_fwdom()dref_fwdoq()dref_fwdoy()
last daydref_ldom()dref_ldoq()dref_ldoy()
last working daydref_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)

Copy Link

Version

Install

install.packages('actuaryr')

Monthly Downloads

247

Version

1.1.1

License

MIT + file LICENSE

Maintainer

Zuzanna Chmielewska

Last Published

April 13th, 2020

Functions in actuaryr (1.1.1)

dref_fwdoq

First working day of a quarter
dref_lwdoq

Last working day of a quarter
dref_fwdom

First working day of a month
dref_lwdoy

Last working day of an year
get_common_columns

Get common columns across two tables
dref_fwdoy

First working day of an year
dref_ytd

Year to date
dref_lwdom

Last working day of a month
dref_ldoy

Last day of an year
dref_ldoq

Last day of a quarter
dref_ldom

Last day of a month
dref_qtd

Quarter to date
dref_mtd

Month to date
get_common_nr_rows

Get common number of rows across two tables
get_common_types

Get common types of columns across two tables
print.ircurve

Print ircurve
as_ircurve

Create an interest rates curve
as

Change into a chosen type
dref_fdoy

First day of an year
dref_fdom

First day of a month
dref_fdoq

First day of a quarter
change_period

Change the period of an interest rates curve
change_type

Change the type of an interest rates curve
compare

Compare two tables
coerce_to_character

Coerce factors/POSIXct/Dates into characters