lookup_term_value: Look up an exact rating term value

View source: R/lookup.R

lookup_term_valueR Documentation

Look up an exact rating term value

Description

Compatibility wrapper around lookup_exact_value(). By default, it returns only the numeric factor value.

Usage

lookup_term_value(row, coverage, plan, term_name, return_match = FALSE, ...)

Arguments

row

A one-row data frame containing the rating record.

coverage

A character string identifying the coverage being rated.

plan

A rating_plan object created by new_rating_plan().

term_name

A character string identifying the rating term to look up.

return_match

Logical. If TRUE, return the complete lookup result; otherwise return only its numeric value.

...

Additional arguments accepted for backward compatibility. They are currently ignored.

Value

If return_match = FALSE, a numeric rating value. If return_match = TRUE, a list containing the value and matching-row information.

Examples

ex <- example_rating_plan()
policy <- ex$policies[1, , drop = FALSE]

lookup_term_value(
  row = policy,
  coverage = "BI",
  plan = ex$plan,
  term_name = "territory"
)

lookup_term_value(
  row = policy,
  coverage = "BI",
  plan = ex$plan,
  term_name = "territory",
  return_match = TRUE
)

ratingtables documentation built on Sept. 6, 2026, 1:06 a.m.