Writes the part of a listing program that reads the data, subsets,
reworks and sorts it, and lays it out:
content <- as_rtftables(data, listing = lst). The program's setup
(library(rtfreporter)) and its report are the caller's.
Usage
tfl_listing_code(
spec,
output_id = NULL,
datasets,
rework = NULL,
type = "multiline",
codelists = NULL,
part = c("all", "data", "content")
)Arguments
- spec
A
tfl_listing_spec(), or the path of its workbook.- output_id
The listing; may be left out when the definition has one.
- datasets
The data catalog (see
tfl_read_data_code()).- rework
Code run on
databefore it is sorted, orNULL.- type
The listing type when the listing's
typeis blank (one of rtfreporter'slisting_spec()types).- codelists
The reports' code lists (a table definition's
codelistssheet, or a data frame withoutput_id,variable,value,label,order): the listing's rows of the columns it shows or sorts by are put on its data after its condition (cl_<variable>andset_levels(), seetfl_helpers_code()) – each such column a factor in its list's order (it sorts so), its values as the list has them.- part
"all"(the whole of it),"data"(the data, up to its order: what a report's content step of its own code reads asdata) or"content"(the listing laid out from adatamade before – by a report's data step of its own code: its code lists, its order, its columns).
Value
The code, one element per line; NULL when the listing names no
dataset yet (part = "content": no columns yet).
See also
tfl_listing() for the pages themselves.