is_exposed_df {actxps} | R Documentation |
Exposed data frame helper functions
Description
Test for and coerce to the exposed_df
class.
Usage
is_exposed_df(x)
as_exposed_df(
x,
end_date,
start_date = as.Date("1900-01-01"),
target_status = NULL,
cal_expo = FALSE,
expo_length = c("year", "quarter", "month", "week"),
trx_types = NULL,
col_pol_num,
col_status,
col_exposure,
col_pol_per,
cols_dates,
col_trx_n_ = "trx_n_",
col_trx_amt_ = "trx_amt_",
default_status
)
Arguments
x |
An object. For |
end_date |
Experience study end date |
start_date |
Experience study start date. Default value = 1900-01-01. |
target_status |
Character vector of target status values. Default value
= |
cal_expo |
Set to TRUE for calendar year exposures. Otherwise policy year exposures are assumed. |
expo_length |
Exposure period length |
trx_types |
Optional. Character vector containing unique transaction
types that have been attached to |
col_pol_num |
Optional. Name of the column in |
col_status |
Optional. Name of the column in |
col_exposure |
Optional. Name of the column in |
col_pol_per |
Optional. Name of the column in |
cols_dates |
Optional. Names of the columns in |
col_trx_n_ |
Optional. Prefix to use for columns containing transaction counts. |
col_trx_amt_ |
Optional. Prefix to use for columns containing transaction amounts. |
default_status |
Optional scalar character representing the default active status code. If not provided, the most common status is assumed. |
Details
is_exposed_df()
will return TRUE
if x
is an exposed_df
object.
as_exposed_df()
will coerce a data frame to an exposed_df
object if that
data frame has columns for policy numbers, statuses, exposures,
policy periods (for policy exposures only), and exposure start / end dates.
Optionally, if x
has transaction counts and amounts by type, these can
be specified without calling add_transactions()
.
Value
For is_exposed_df()
, a length-1 logical vector. For
as_exposed_df()
, an exposed_df
object.
See Also
expose()
for information on how exposed_df
objects are typically
created from census data.