Generic pointblank validation helper for eData tables
Source:R/fct_validate_pointblank.R
pb_validate_edata_table.RdApplies pointblank validation rules to check data quality and schema compliance for eData format tables. Can operate in two modes:
Agent mode (
agent = TRUE): Creates an agent for reporting and interrogationPipeline mode (
agent = FALSE): Returns validated data directly for use in pipelines
Usage
pb_validate_edata_table(
data,
table_name,
validation_steps,
agent = TRUE,
actions = action_levels()
)Arguments
- data
Data frame to validate
- table_name
Name of the table being validated (for reporting)
- validation_steps
Function that takes a data frame or agent and returns it with validation steps added. Should be a function like:
function(x) { x |> col_vals_not_null(...) |> ... }- agent
Logical. If
TRUE(default), returns a pointblank agent object. IfFALSE, returns the validated data with validation failures removed.- actions
Action levels for pointblank agent (only used when
agent = TRUE)
Value
If agent = TRUE, a pointblank agent object containing validation results.
If agent = FALSE, the input data with validation failures removed.
Details
Uses pointblank::create_agent() to build a validation agent in agent mode,
or applies steps directly to the data in pipeline mode.
Called by pb_validate_*() functions to apply specific table validation steps
In agent mode, the agent object can be used to:
Extract validation results with
get_sundered_data()Generate reports with
get_agent_report()Check pass/fail status
In pipeline mode, failed rows are automatically removed from the data.
See also
Other validation:
pb_validate_CREED_data_relevance(),
pb_validate_CREED_data_reliability(),
pb_validate_CREED_scores(),
pb_validate_all_edata_tables(),
pb_validate_biota(),
pb_validate_campaign(),
pb_validate_measurements(),
pb_validate_methods(),
pb_validate_parameters(),
pb_validate_reference(),
pb_validate_samples(),
pb_validate_sites()