View source: R/build_figures.R
| build_figures | R Documentation | 
nlmixr2 ReportCreates figures specified in a rptyaml file
build_figures(
  obnd = NULL,
  fit = NULL,
  rptdetails = NULL,
  cat_covars = NULL,
  cont_covars = NULL,
  verbose = TRUE
)
obnd | 
 
  | 
fit | 
 
  | 
rptdetails | 
 Object created 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  | 
List containing the figures with the following structure:
"rptfigs" - List of figures with names corresponding to the
figure ids in the yaml file. Each figure ID contains the following elements:
"figure"       - list of figure file names for the current fid
"orientation"  - Figure orientation ("portrait" or "landscape")
"isgood"       - Boolean variable indicating success or failure
"skip"         - Boolean variable indicating whether the figure should be skipped during reporting
"fmsgs"        - Vector of messages
"cmd"          - Original plot generation command
"cmd_proc"     - Plot generation command after processing for placeholders
"height"       - Figure height
"width"        - Figure 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
# We need an onbrand object to use below
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 figures
bfres = build_figures(obnd       = obnd,
                     fit        = fit, 
                     rptdetails = rptdetails)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.