View source: R/new_rating_plan.R
| new_rating_plan | R Documentation |
Create a rating plan
new_rating_plan(
factor_table,
rating_spec,
coverages,
use_rate_set_key = FALSE,
max_vars = 12,
policy_id_col = "policy_id",
custom_functions = list(),
validate = TRUE,
metadata = list()
)
factor_table |
A normalized long-format data frame containing at least
|
rating_spec |
A data frame containing at least |
coverages |
A character vector naming the coverages to rate. |
use_rate_set_key |
Logical. If |
max_vars |
A nonnegative integer giving the maximum number of variable-level slot pairs in the factor table. |
policy_id_col |
A single character string naming the policy or record
identifier column. Its value is stored as |
custom_functions |
A named list of custom rating functions referenced
by rating-specification rows with |
validate |
Logical. If |
metadata |
An optional list stored unchanged in the rating-plan object. |
Exact lookup structure and standard rating-step metadata are precompiled
when the plan is created. Value-only edits to plan$factor_table$term_value
can reuse the compiled lookup structure. If lookup keys or the rating
specification are changed, rate_policies() detects the structural change
and rebuilds the internal cache before rating.
A rating_plan object containing the normalized factor table,
rating specification, coverages, configuration, custom functions, and
metadata. The object also contains an internal precompiled cache used by
the standard non-trace batch-rating engine. The cache is an implementation
detail and should not be edited directly.
ex <- example_rating_plan()
plan <- new_rating_plan(
factor_table = ex$plan$factor_table,
rating_spec = ex$plan$rating_spec,
coverages = "BI"
)
print(plan)
summary(plan)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.