Generate a complete parameter table ready for rendering via pmtables

make_pmtable(
  .df,
  .pmtype = c("full", "fixed", "structural", "covariate", "random"),
  .width = 1
)

Arguments

.df

parameter data set output from pmparams::format_param_table.

.pmtype

parameter table type. Options include:

  • "full" (all rows in .df retained in pmtable). This is the default.

  • "fixed" (all rows with type = "Struct" or "effect"),

  • "structural" (all rows with type = "Struct"),

  • "covariate" (all rows with type = "effect"),

  • "random" (all rows with greek = "Omega" or type = "Resid").

.width

notes width. Defaults to 1.

Details

Generates specific parameter tables by filtering and using pmtables

This function:

  1. Filters to columns needed for specific parameter tables

  2. Panels by "type"

  3. Makes "abb", "greek", "desc" blank (no title)

    • Note that description is removed when .pmtype = "random". See ?pmtables::st_mutate() if you want to add it back in.

  4. Attaches notes

  5. Rename "value" to "Estimate" and "shrinkage" to "Shrinkage (%)", if applicable

Note: If these pmtables settings do not work for your parameter table, you can overwrite them afterwards using desired pmtables commands.

Examples


model_dir <- system.file("model/nonmem", package = "pmparams")
paramKey <-  file.path(model_dir, "pk-parameter-key-new.yaml")

# Read in parameter estimates (or provide `bbr` model)
param_est <- utils::read.csv(file.path(model_dir, "param_est_102.csv"))

# Create formatted parameter table
param_df <- define_param_table(
 .estimates = param_est,
 .key = paramKey
) %>% format_param_table()

if (FALSE) { # \dontrun{

# Create random effects table that can be rendered to latex
make_pmtable(param_df, .pmtype = "random") %>%
 pmtables::stable() %>%
 # preview in Rstudio viewer (requires `magick` and `pdftools`)
 pmtables::st_as_image()
} # }