pointblank: Was I expecting this?

rainbowR 2026

Hannah Frick, Posit

Core code pattern

library(pointblank)

# create
create_agent(table_to_validate) |>
  # specify
  col_vals_gt(column_d, value = 200) |>
  # ...
  # apply
  interrogate()

Thresholds and actions

agent <- create_agent(
  tbl = table_to_validate,
  actions = action_levels(
    warn_at = 2, # absolute threshold
    stop_at = 0.2, # relative threshold
    notify_at = 0.3,
    fns = list(warn = ~ warning("Data (life?) is getting messy."))
  )
) |>
  col_vals_gt(column_d, value = 200) |>
  interrogate()

Trigger an email notification

create_agent(
  small_table,
  actions = action_levels(notify_at = 0.3),
  end_fns = list(
    ~ email_blast(
      x,
      to = "hello@rainbowr.org",
      from = "pb_notify@example.com",
      msg_subject = "I was not expecting this!",
      credentials = blastula::creds_key(id = "smtp2go"),
      send_condition = ~ TRUE %in% x$notify
    )
  )
)

Program against the results

  • Validation results: get_agent_x_list()
  • Data that failed any rule: get_sundered_data()
  • Data that failed a specific rule: get_data_extracts(i = 1)