H02 Turn data into a product definition
Use your current course session. Preparation and course runner · R script ↓
H02 Turn data into a product definition
Goal: Distinguish data from a reusable definition.
Prerequisites: policies from H01.
dr_product assigns an identity and source. Rules, preparation and a target can be added later. Constructing or inspecting a product does not execute it. A product ID is not a file path.
policy_product <- dr_product("policies", data = policies)
product_info <- dr_inspect(policy_product)
print(product_info[c("id", "status", "sources")])
stopifnot(identical(product_info$id, "policies"))
stopifnot(identical(product_info$status, "defined"))Expected result: The inspection shows id policies, status defined and a table source.
Task: Have we saved a file or checked whether premiums are sensible?
Show solution
Neither. We have described a product with a local source. Next, execute that definition.