expose_split: Split calendar exposures by policy year

View source: R/expose_split.R

expose_splitR Documentation

Split calendar exposures by policy year

Description

Split calendar period exposures that cross a policy anniversary into a pre-anniversary record and a post-anniversary record.

After splitting the data, the resulting data frame will contain both calendar exposures and policy year exposures. These columns will be named exposure_cal and exposure_pol, respectively. Calendar exposures will be in the original units passed to expose_split(). Policy exposures will always be expressed in years.

After splitting exposures, downstream functions like exp_stats() and exp_shiny() will require clarification as to which exposure basis should be used to summarize results.

is_split_exposed_df() will return TRUE if x is a split_exposed_df object.

Usage

expose_split(.data)

is_split_exposed_df(x)

Arguments

.data

An exposed_df object with calendar period exposures.

x

Any object

Details

.data must be an exposed_df with calendar year, quarter, month, or week exposure records. Calendar year exposures are created by the functions expose_cy(), expose_cq(), expose_cm(), or expose_cw(), (or expose() when cal_expo = TRUE).

Value

For expose_split(), a tibble with class split_exposed_df, exposed_df, tbl_df, tbl, and data.frame. The results include all columns in .data except that exposure has been renamed to exposure_cal. Additional columns include:

  • exposure_pol - policy year exposures

  • pol_yr - policy year

For is_split_exposed_df(), a length-1 logical vector.

See Also

expose() for information on creating exposure records from census data.

Examples

toy_census |> expose_cy("2022-12-31") |> expose_split()


actxps documentation built on June 26, 2024, 9:07 a.m.