The chevron_tlg S4 class associates a preprocess function, a main tlg function and a postprocess function.
chevron_t, a subclass of chevron_tlg with specific validation criteria to handle table creation
chevron_l, a subclass of chevron_tlg with specific validation criteria to handle listing creation
chevron_g, a subclass of chevron_tlg with specific validation criteria to handle graph creation
chevron_simple, a subclass of chevron_tlg, where main function is a simple call
Usage
chevron_t(
main = function(adam_db, ...) build_table(basic_table(), adam_db[[1]]),
preprocess = function(adam_db, ...) adam_db,
postprocess = std_postprocessing,
dataset = NULL,
...
)
chevron_l(
main = function(adam_db, ...) data.frame(),
preprocess = function(adam_db, ...) adam_db,
postprocess = std_postprocessing,
dataset = NULL,
...
)
chevron_g(
main = function(adam_db, ...) ggplot2::ggplot(),
preprocess = function(adam_db, ...) adam_db,
postprocess = std_postprocessing,
dataset = NULL,
...
)
chevron_simple()Arguments
- main
(
function) returning atlg, withadam_dbas first argument. Typically one of the_mainfunction ofchevron.- preprocess
(
function) returning a pre-processedlistofdata.frames, withadam_dbas first argument. Typically one of the_prefunction ofchevron.- postprocess
(
function) returning a post-processedtlg, withtlgas first argument.- dataset
(
string) the name of a table in theadam_dbobject.- ...
not used
Value
a chevron_t class object.
a chevron_l class object.
a chevron_g class object.
a chevron_simple class object.
Slots
main(
function) returning atlg. Typically one of the*_mainfunction fromchevron.preprocess(
function) returning a pre-processedlistofdata.framesamenable totlgcreation. Typically one of the*_prefunction fromchevron.postprocess(
function) returning a post-processedtlg. Typically one of the*_postfunction fromchevron.dataset(
character) the names of the data sets used in thechevron_tlgobject. IfNULL, all data sets are possibly used.
Note
To ensure the correct execution of the workflow, additional validation criteria are:
the first argument of the
mainfunction must beadam_db, the inputlistofdata.framesto pre-process. The...argument is mandatory.the first argument of the
preprocessfunction must beadam_db, the inputlistofdata.framesto createtlgoutput. The...argument is mandatory.the first argument of the
postprocessfunction must betlg, the inputTableTreeobject to post-process. The...argument is mandatory.
Examples
chevron_t_obj <- chevron_t()
chevron_t_obj <- chevron_t(postprocess = function(tlg, indent, ...) {
rtables::table_inset(tlg) <- indent
tlg
})
chevron_l_obj <- chevron_l()
chevron_g_obj <- chevron_g()
chevron_g_obj <- chevron_g(
postprocess = function(tlg, title, ...) tlg + ggplot2::labs(main = title)
)
chevron_simple_obj <- chevron_simple()