pol_yr {actxps} | R Documentation |
Calculate policy duration
Description
Given a vector of dates and a vector of issue dates, calculate policy years, quarters, months, weeks, or other durations.
Usage
pol_yr(x, issue_date)
pol_qtr(x, issue_date)
pol_mth(x, issue_date)
pol_wk(x, issue_date)
pol_interval(x, issue_date, dur_length)
Arguments
x |
A vector of dates |
issue_date |
A vector of issue dates |
dur_length |
A period object. See |
Details
These functions assume the first day of each policy year is the anniversary date (or issue date in the first year). The last day of each policy year is the day before the next anniversary date. Analogous rules are used for policy quarters, policy months, and policy weeks.
The pol_interval()
function can be used to determine any arbitrary
duration passed to the dur_length
argument.
Value
An integer vector
Examples
pol_yr(as.Date("2021-02-28") + 0:2, "2020-02-29")
pol_mth(as.Date("2021-02-28") + 0:2, "2020-02-29")
[Package actxps version 1.4.0 Index]