set_tbl {pointblank} | R Documentation |
Set a data table to an agent or an informant
Description
Setting a data table to an agent or an informant with set_tbl()
replaces any associated table (a data frame, a tibble, objects of class
tbl_dbi
or tbl_spark
).
Usage
set_tbl(x, tbl, tbl_name = NULL, label = NULL)
Arguments
x |
A pointblank agent or informant object
An agent object of class |
tbl |
Table or expression for reading in one
The input table for the agent or the informant. This can be a data
frame, a tibble, a |
tbl_name |
A table name
A optional name to assign to the new input table object. If no value is provided, a name will be generated based on whatever information is available. |
label |
An optional label for reporting
An optional label for the validation plan or information report. If no value is provided then any existing label will be retained. |
Examples
Set proportional failure thresholds to the warn
, stop
, and notify
states using action_levels()
.
al <- action_levels( warn_at = 0.10, stop_at = 0.25, notify_at = 0.35 )
Create an agent that has small_table
set as the target table via tbl
.
Apply the actions, add some validation steps and then interrogate the data.
agent_1 <- create_agent( tbl = small_table, tbl_name = "small_table", label = "An example.", actions = al ) %>% col_exists(columns = c(date, date_time)) %>% col_vals_regex( columns = b, regex = "[0-9]-[a-z]{3}-[0-9]{3}" ) %>% rows_distinct() %>% interrogate()
Replace the agent's association to small_table
with a mutated version of it
(one that removes duplicate rows). Then, interrogate the new target table.
agent_2 <- agent_1 %>% set_tbl( tbl = small_table %>% dplyr::distinct() ) %>% interrogate()
Function ID
9-4
See Also
Other Object Ops:
activate_steps()
,
deactivate_steps()
,
export_report()
,
remove_steps()
,
x_read_disk()
,
x_write_disk()