The tbl_source() function provides a convenient means to access a table-prep formula from either a tbl_store object or a table store YAML file (which can be created with the yaml_write() function). A call to tbl_source() is most useful as an input to the tbl argument of create_agent(), create_informant(), or set_tbl().
Should you need to obtain the table itself (that is generated via the table-prep formula), then the tbl_get() function should be used for that.
tbl_source(tbl, store =NULL)
Arguments
tbl: The table name associated with a table-prep formula. This is part of the table store. This table could be identified by its name (e.g., tbl = "large_table") or by supplying a reference using a subset (with $) of the tbl_store object (e.g., tbl = store$large_table). If using the latter method then nothing needs to be supplied to store.
store: Either a table store object created by the tbl_store()
function or a path to a table store YAML file created by yaml_write().
Returns
A table-prep formula.
Examples
Let's create a tbl_store object by giving two table-prep formulas to tbl_store().
We can likewise write the agent to a YAML file with yaml_write() (writes to
agent-sml_table.yml by default but the filename allows for any filename
you want).
yaml_write(agent_2)
Now that both the agent and the associated table store are present as on-disk
YAML, interrogations can be done by using yaml_agent_interrogate().