Learn R Programming

pointblank (version 0.3.0)

get_data_extracts: Collect data extracts from a validation step

Description

Get data that didn't pass a validation step. The amount of data available in a particular extract depends on both the fraction of validation units that didn't pass a validation step and the level of sampling or explicit collection from that set of units (this is defined within the interrogate() call).

Usage

get_data_extracts(agent, i = NULL)

Arguments

agent

An agent object of class ptblank_agent. It should have had interrogate() called on it, such that the validation steps were carried out and any sample rows from non-passing validations could potentially be available in the object.

i

The validation step number, which is assigned to each validation step in the order of definition.

Value

A list of tibbles if i is not provided, or, a tibble if i is given.

Function ID

3-4

See Also

Other Interrogate and Get Info: all_passed(), get_agent_report(), interrogate()

Examples

Run this code
# NOT RUN {
library(dplyr)

# Create a simple table with a
# column of numerical values
tbl <- tibble(a = c(5, 7, 8, 5))

# Create 2 simple validation steps
# that test whether values within
# column `a`
agent <-
  create_agent(tbl = tbl) %>%
  col_vals_between(vars(a), 4, 6) %>%
  col_vals_lte(vars(a), 7) %>%
  interrogate(
    extract_failed = TRUE,
    get_first_n = 10
  )

# Get row sample data for those rows
# in `tbl` that did not pass the first
# validation step (`col_vals_between`)
agent %>% get_data_extracts(i = 1)

# }

Run the code above in your browser using DataLab