nlmixr (version 1.1.1-1)

nmDocx: Create a run summary word document

Description

Create a run summary word document

Usage

nmDocx(x, docxOut = NULL, docxTemplate = NULL, plot = TRUE,
  titleStyle = getOption("nlmixr.docx.title", "Title"),
  subtitleStyle = getOption("nlmixr.docx.subtitle", "Subtitle"),
  normalStyle = getOption("nlmixr.docx.normal", "Normal"),
  headerStyle = getOption("nlmixr.docx.heading1", "Heading 1"),
  centeredStyle = getOption("nlmixr.docx.centered", "centered"),
  preformattedStyle = getOption("nlmixr.docx.preformatted",
  "HTML Preformatted"), width = getOption("nlmixr.docx.width", 69),
  save = FALSE)

nmSave(x, ..., save = TRUE)

Arguments

x

nlmixr fit object.

docxOut

Output file for run information document. If not specified it is the name of R object where the fit is located with the -YEAR-MONTH-DAY.docx appended. If it is NULL the document is not saved, but the officer object is returned.

docxTemplate

This is the document template. If not specified it defaults to option("nlmixr.docx.template"). If option("nlmixr.docx.template") is not specified it uses the included nlmixr document template. When docxTemplate=NULL it uses the officer blank document.

plot

Boolean indicating if the default goodness of fit plots are added to the document. By default TRUE

titleStyle

This is the word style name for the nlmixr title; Usually this is nlmixr version (R object). Defaults to option("nlmixr.docx.title") or Title

subtitleStyle

This is the word style for the subtitle which is nlmixr model name and date. Defaults to option("nlmixr.docx.subtitle") or Subtitle

normalStyle

This is the word style for normal text. Defaults to option("nlmixr.docx.normal") or Normal

headerStyle

This is the word style for heading text. Defaults to option("nlmixr.docx.heading1") or Heading 1

centeredStyle

This is the word style for centered text which is used for the figures. Defaults to option("nlmixr.docx.centered") or centered

preformattedStyle

This is the preformatted text style for R output lines. Defaults to option("nlmixr.docx.preformatted") or HTML Preformatted

width

Is an integer representing the number of characters your preformatted style supports. By default this is option("nlmixr.docx.width") or 69

save

Should the docx be saved in a zip file with the R rds data object for the fit? By default this is FALSE with nmDocx and TRUE with nmSave

...

when using `nmSave` these arguments are passed to `nmDocx`

Value

An officer docx object

Examples

Run this code
# NOT RUN {
 library(nlmixr)
pheno <- function() {
    # Pheno with covariance
  ini({
    tcl <- log(0.008) # typical value of clearance
    tv <-  log(0.6)   # typical value of volume
    ## var(eta.cl)
    eta.cl + eta.v ~ c(1,
                       0.01, 1) ## cov(eta.cl, eta.v), var(eta.v)
                      # interindividual variability on clearance and volume
    add.err <- 0.1    # residual variability
  })
  model({
    cl <- exp(tcl + eta.cl) # individual value of clearance
    v <- exp(tv + eta.v)    # individual value of volume
    ke <- cl / v            # elimination rate constant
    d/dt(A1) = - ke * A1    # model differential equation
    cp = A1 / v             # concentration in plasma
    cp ~ add(add.err)       # define error model
  })
}

fit.s <- nlmixr(pheno, pheno_sd, "saem")

## Save output information into a word document
nmDocx(fit.s)

# }

Run the code above in your browser using DataCamp Workspace