One content item: its code, its written arguments, its own part
Source:R/item_ops.R
tfl_item_code.Rdtfl_item_code(): the item's one call, astfl_content_code()writes it (noplan <-, no pipe).tfl_item_written(): the names of the arguments its code writes – the arguments given, an!unsetorNULLone left out; a verb's positional...(plan_titles("A", "B")) is"...".tfl_item_own(): what the report's own layer holds of the item, given the itembelowit (the layers' without the report's own,tfl_resolve_output()'sprovenance = TRUE). A verb whose...is named (plan_cells()...) keeps only the keys whose value differs from below's, and a key below has that the item has not is!unset; any other verb is the item whole, orNULLwhen it is the same as below's (the own item can go). Values are compared as their R text, so30and30Lare the same.
Arguments
- item
A
tfl_item().- pipe
Unused: the call alone (kept for the code's form to come).
- below
The item below it, or
NULL(no layer has the verb: the item is all the report's own).
Value
tfl_item_code(): the code, one element a line.
tfl_item_written(): the argument names. tfl_item_own(): a
tfl_item() or NULL.
Examples
it <- tfl_item("plan_cells", list(continuous = list(n = "{N}"), default = "{n} ({p}%)"))
tfl_item_code(it)
#> [1] "plan_cells(continuous = list(n = \"{N}\"), default = \"{n} ({p}%)\")"
tfl_item_written(it)
#> [1] "continuous" "default"
below <- tfl_item("plan_cells", list(default = "{n} ({p}%)"), from = "defaults")
tfl_item_own(it, below)$args
#> $continuous
#> $continuous$n
#> [1] "{N}"
#>
#>