Creates tables specified in a rptyaml file
Usage
build_tables(
obnd = NULL,
fit = NULL,
rptdetails = NULL,
cat_covars = NULL,
cont_covars = NULL,
verbose = TRUE
)
Arguments
- obnd
onbrand report object to have report elements appended to
- fit
nlmixr2 fit object to be reported
- rptdetails
object creating when reading in rptyaml file
- cat_covars
character vector of categorical covariates to overwrite defaults in yaml file
- cont_covars
character vector of continuous covariates to overwrite defaults in yaml file
- verbose
Boolean variable when set to TRUE (default) messages will be displayed on the terminal
Value
List containing the tables with the following structure:
"rpttabs"
- List of tables with names corresponding to the table ids in the yaml file. It contains the elements from the yamle file and the following elements:"table"
- Result of build (t_res object)"orientation"
- Table orientation ("portrait" or "landscape")"isgood"
- Boolean variable indicating success or failure"skip"
- Boolean variable indicating whether the table should be skipped during reporting"tmsgs"
- Vector of messages"cmd"
- Original plot generation command"cmd_proc"
- Plot generation command after processing for placeholders"height"
- Table height"width"
- Table width"caption"
- Caption for Word"caption_proc"
- Caption for Word after processing for placeholders"title"
- Slide title for PowerPoint"title_proc"
- Slide title for PowerPoint after processing for placeholders
"isgood"
- Boolean variable indicating success or failure"msgs"
- Vector of messages
Examples
# We need an onbrand object to use below
# \donttest{
library(onbrand)
obnd = read_template(
template = system.file(package="nlmixr2rpt", "templates","nlmixr_obnd_template.docx"),
mapping = system.file(package="nlmixr2rpt", "templates","nlmixr_obnd_template.yaml"))
# We also need an nlmixr fit object
fit = fetch_fit_example()
# This reads in the report details as well
rptdetails = yaml_read_fit(
obnd = obnd,
rptyaml = system.file(package="nlmixr2rpt", "examples", "report_fit_test.yaml"),
fit = fit)$rptdetails
# Now we will build the tables
btres = build_tables(obnd = obnd,
fit = fit,
rptdetails = rptdetails)
#>
#> ── Building report tables
#> → pest_table
#> → bad_table
#>
#> ── Table generation failed
#> → Unable to generate table
#> → -> call: eval, parse(text = tinfo[["cmd_proc"]])
#> → -> message: object 'bad_table_command' not found
#> → table id: bad_table
#> → command run:
#> → bad_table_command
#> → skip_table
# }