Create a pointblank multiagent objectSource:
Multiple agents can be part of a single object called the multiagent.
This can be useful when gathering multiple agents that have performed
interrogations in the past (perhaps saved to disk with
When be part of a multiagent, we can get a report that shows how data
quality evolved over time. This can be of interest when it's important to
monitor data quality and even the evolution of the validation plan itself.
The reporting table, generated by printing a
ptblank_multiagent object or
by using the
get_multiagent_report() function, is, by default, organized by
the interrogation time and it automatically recognizes which validation steps
are equivalent across interrogations.
One or more pointblank agent objects.
The language to use for any reporting that will be generated from the multiagent. (e.g., individual agent reports, multiagent reports, etc.). By default,
NULLwill create English (
"en") text. Other options include French (
"fr"), German (
"de"), Italian (
"it"), Spanish (
"es"), Portuguese (
"pt"), Turkish (
"tr"), Chinese (
"zh"), Russian (
"ru"), Polish (
"pl"), Danish (
"da"), Swedish (
"sv"), and Dutch (
An optional locale ID to use for formatting values in the reporting outputs according the locale's rules. Examples include
"en_US"for English (United States) and
"fr_FR"for French (France); more simply, this can be a language identifier without a country designation, like "es" for Spanish (Spain, same as
For the example below, we'll use two different, yet simple tables.
## # A tibble: 6 × 6 ## a b c d e f ## <dbl> <dbl> <dbl> <chr> <chr> <chr> ## 1 5 1 1 E A A ## 2 5 1 1 E A A ## 3 5 1 1 E A A ## 4 5 2 2 E B B ## 5 5 2 3 E B C ## 6 5 2 4 E B D
## # A tibble: 6 × 2 ## a b ## <dbl> <chr> ## 1 5 A ## 2 7 B ## 3 6 C ## 4 5 D ## 5 8 E ## 6 7 F
Next, we'll create two different agents, each interrogating a different table.
First up, is
agent_1 <- create_agent( tbl = tbl_1, tbl_name = "tbl_1", label = "Example table 1." ) %>% col_vals_gt(columns = vars(a), value = 4) %>% interrogate()
agent_2 <- create_agent( tbl = tbl_2, tbl_name = "tbl_2", label = "Example table 2." ) %>% col_is_character(columns = vars(b)) %>% interrogate()
Now, we'll combine the two agents into a multiagent with the
create_multiagent() function. Printing the
displays the multiagent report with its default options (i.e., a 'long'
multiagent <- create_multiagent(agent_1, agent_2) multiagent
To take advantage of more display options, we could use the
get_multiagent_report() function. The added functionality there allows for
a 'wide' view of the data (useful for monitoring validations of the same
table over repeated interrogations), the ability to modify the title of the
multiagent report, and a means to export the report to HTML (via