| join_entity_values | R Documentation |
Left-join aggregated entity-level values back to the parent-level rating
data. When the entity-side join keys are unique and there are no overlapping
non-key column names, a direct keyed match is used. More complicated joins
fall back to base merge() to preserve general behavior.
join_entity_values(parent_data, entity_values, by)
parent_data |
A data frame containing parent-level records. |
entity_values |
A data frame containing aggregated entity values. |
by |
A character vector naming the column or columns used to join the two data frames. |
A data frame containing all rows from parent_data with matching
columns from entity_values.
policies <- data.frame(
policy_id = c("P1", "P2"),
base_premium = c(100, 120)
)
driver_values <- data.frame(
policy_id = c("P1", "P2"),
average_driver_factor = c(1.05, 0.95)
)
join_entity_values(
parent_data = policies,
entity_values = driver_values,
by = "policy_id"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.