View source: R/trace_helpers.R
| trace_to_wide_factors | R Documentation |
Convert normalized trace rows into one row per unique combination of
identifying columns, with a separate column for each rating step. Generated
step columns contain the trace's applied_value.
trace_to_wide_factors(
term_trace,
id_cols = c("row_number", "record_id", "coverage")
)
term_trace |
A data frame containing normalized rating trace rows,
typically from |
id_cols |
A character vector naming columns in |
If term_trace is nonempty, a data frame with one row per unique
combination of the available id_cols and columns named
step_<number>_<term> containing applied step values. If term_trace is
empty, the empty input data frame is returned unchanged.
ex <- example_rating_plan()
result <- rate_policies_with_trace(
ex$policies,
ex$plan
)
trace_to_wide_factors(
result$term_trace
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.