DRDataRaft/ docs
GitHub ↗

H07 Correct data without redefining the product

H07Data, products and quality1 step

Use your current course session. Preparation and course runner · R script ↓

H07 Correct data without redefining the product

Goal: Replace a source while keeping its rules.

Prerequisites: H06.

The source name policies comes from the original product ID. Requirements remain attached while the source is replaced.

training_step(
  "H07",
  {
    corrected_policies <- bad_policies
    corrected_policies$premium[2] <- 150
    policy_product <- dr_set_sources(
      policy_product,
      policies = corrected_policies
    )
    policy_run <- dr_run(policy_product, write = FALSE)
    print(dr_collect(policy_run))
    stopifnot(policy_run$validation_status == "passed")
  },
  needs = c("H06")
)

Expected result: Six accepted policies.

Task: Did we have to rewrite the rule?

Show solution

No. Sources and requirements are separate. Next, add preparation.

Search documentation

Search functions, packages and guides.