Get an agent from pointblank YAML and interrogate()
Get an agent from pointblank YAML and interrogate()
The yaml_agent_interrogate() function operates much like the yaml_read_agent() function (reading a pointblank YAML file and generating an agent with a validation plan in place). The key difference is that this function takes things a step further and interrogates the target table (defined by table-prep formula that is required in the YAML file). The additional auto-invocation of interrogate() uses the default options of that function. As with yaml_read_agent() the agent is returned except, this time, it has intel from the interrogation.
yaml_agent_interrogate(filename, path =NULL)
Arguments
filename: File name
scalar<character> // required
The name of the YAML file that contains fields related to an agent.
path: #' @param path File path
scalar<character> // default:NULL (optional)
An optional path to the YAML file (combined with filename).
Returns
A ptblank_agent object.
Examples
There's a YAML file available in the pointblank package that's also called "agent-small_table.yml". The path for it can be accessed through system.file():
This particular agent is using ~ tbl_source("small_table", "tbl_store.yml")
to source the table-prep from a YAML file that holds a table store (can be
seen using yaml_agent_string(agent = agent)). Let's put that file in the
working directory (the pointblank package has the corresponding YAML file):
As can be seen from the validation report, no interrogation was yet
performed. Saving an agent to YAML will remove any traces of interrogation
data and serve as a plan for a new interrogation on the same target table. We
can either follow this up with with interrogate() and get an agent with
intel, or, we can interrogate directly from the YAML file with
yaml_agent_interrogate():