interrogate | R Documentation |
When the agent has all the information on what to do (i.e., a validation plan
which is a series of validation steps), the interrogation process can occur
according its plan. After that, the agent will have gathered intel, and we
can use functions like get_agent_report()
and all_passed()
to understand
how the interrogation went down.
interrogate(
agent,
extract_failed = TRUE,
extract_tbl_checked = TRUE,
get_first_n = NULL,
sample_n = NULL,
sample_frac = NULL,
sample_limit = 5000,
show_step_label = FALSE,
progress = interactive()
)
agent |
The pointblank agent object
A pointblank agent object that is commonly created through the use of
the |
extract_failed |
Collect failed rows as data extracts
An option to collect rows that didn't pass a particular validation step.
The default is |
extract_tbl_checked |
Collect validation results from each step
An option to collect processed data frames produced by executing the
validation steps. This information is necessary for some functions
(e.g., |
get_first_n |
Get the first n values
If the option to collect non-passing rows is chosen, there is the option
here to collect the first |
sample_n |
Sample n values
If the option to collect non-passing rows is chosen, this option allows for
the sampling of |
sample_frac |
Sample a fraction of values
If the option to collect non-passing rows is chosen, this option allows for
the sampling of a fraction of those rows. Provide a number in the range of
|
sample_limit |
Row limit for sampling
A value that limits the possible number of rows returned when sampling
non-passing rows using the |
show_step_label |
Show step labels in progress
Whether to show the |
progress |
Show interrogation progress
Whether to show the progress of an agent's interrogation in the console.
Defaults to |
A ptblank_agent
object.
Create a simple table with two columns of numerical values.
tbl <- dplyr::tibble( a = c(5, 7, 6, 5, 8, 7), b = c(7, 1, 0, 0, 0, 3) ) tbl #> # A tibble: 6 x 2 #> a b #> <dbl> <dbl> #> 1 5 7 #> 2 7 1 #> 3 6 0 #> 4 5 0 #> 5 8 0 #> 6 7 3
Validate that values in column a
from tbl
are always less than 5
. Using
interrogate()
carries out the validation plan and completes the whole
process.
agent <- create_agent( tbl = tbl, label = "`interrogate()` example" ) %>% col_vals_gt(columns = a, value = 5) %>% interrogate()
We can print the resulting object to see the validation report.
agent
6-1
Other Interrogate and Report:
get_agent_report()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.