Learn R Programming

pointblank (version 0.3.0)

get_agent_report: Get a simple report from an agent

Description

We can get the essential information from an agent by using the get_agent_report() function. The amount of fields with intel is different depending on whether or not the agent performed an interrogation (with interrogate()). The tibble that is returned has the following columns:

  • i: the validation step number

  • type: the validation type, which mirrors the name of the validation step function

  • columns: the names of the columns used in the validation step

  • value: the numeric value used in the validation step, where applicable

  • set: the set values used in the validation step; for a conjointly() validation step, this is a listing of all sub-validations

  • regex: the regex used for a col_vals_regex() validation step

  • preconds: a logical value indicating whether any preconditions where applied before interrogation

  • units: the total number of validation units for the validation step

  • n_pass: the number of validation units that received a pass

  • f_pass: the fraction of validation units that received a pass

  • W: a logical value stating whether the warn state was entered

  • S: a logical value stating whether the stop state was entered

  • N: a logical value stating whether the notify state was entered

  • extract: a logical value that indicates whether a data extract is available for the validation step

If the gt package is installed (and if display_table = TRUE) then a gt table will be displayed with the same information.

Usage

get_agent_report(agent, display_table = TRUE)

Arguments

agent

An agent object of class ptblank_agent.

display_table

Should a display table be generated? If TRUE, and if the gt package is installed, a display table for the report will be shown in the Viewer. If FALSE, or if gt is not available, then a tibble will be returned.

Value

A tibble.

Function ID

3-3

See Also

Other Interrogate and Get Info: all_passed(), get_data_extracts(), 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))

# Validate that values in column
# `a` are always greater than 4
agent <-
  create_agent(tbl = tbl) %>%
  col_vals_gt(vars(a), 4) %>%
  interrogate()

# Get a tibble-based report from the
# agent by using `get_agent_report()`
agent %>%
  get_agent_report(display_table = FALSE)

# }

Run the code above in your browser using DataLab