Learn R Programming

pointblank (version 0.6.0)

set_read_fn: Set a table-reading function to an agent or informant

Description

A table-reading function can be associated with an agent or informant with set_read_fn(). Should both a tbl and a read_fn be associated with the agent or informant, the read_fn will take priority. There are two ways to specify a read_fn: (1) using a function (e.g., function() { <table reading code> }) or, (2) with an R formula expression (e.g., ~ { <table reading code> }). The table-reading function can removed with remove_read_fn().

Usage

set_read_fn(x, read_fn)

Arguments

x

An agent object of class ptblank_agent, or, an informant of class ptblank_informant.

read_fn

A function that's used for reading in the data. This can be specified by using a function (e.g., function() { <table reading code> }) or an R formula expression (e.g., ~ { <table reading code> }).

Function ID

8-5

See Also

Other Object Ops: remove_read_fn(), remove_tbl(), set_tbl(), x_read_disk(), x_write_disk()