Writing an agent or informant to disk with x_write_disk() can be useful for keeping data validation intel or table information close at hand for later retrieval (with x_read_disk()). By default, any data table that the agent or informant may have held before being committed to disk will be expunged. This behavior can be changed by setting keep_tbl to TRUE but this only works in the case where the table is not of the tbl_dbi or the tbl_spark class.

x_write_disk(
x,
filename,
path = NULL,
keep_tbl = FALSE,
keep_extracts = FALSE,
quiet = FALSE
)

## Arguments

x An agent object of class ptblank_agent, or, an informant of class ptblank_informant. The filename to create on disk for the agent or informant. An optional path to which the file should be saved (this is automatically combined with filename). An option to keep a data table that is associated with the agent or informant (which is the case when the agent, for example, is created using create_agent(tbl =

## Value

Invisibly returns TRUE if the file has been written.

## Details

It is recommended to set up a table-prep formula so that the agent and informant can access refreshed data after being read from disk through x_read_disk(). This can be done initially with the read_fn argument of create_agent()/create_informant() or, later, with set_read_fn(). Alternatively, we can reintroduce the agent or informant to a data table with the set_tbl() function.

## Function ID

9-1

Other Object Ops: activate_steps(), deactivate_steps(), remove_read_fn(), remove_steps(), remove_tbl(), set_read_fn(), set_tbl(), x_read_disk()`