pmtables
R/make_pmtable.R
make_pmtable.Rd
Generate a complete parameter table ready for rendering via pmtables
make_pmtable(
.df,
.pmtype = c("full", "fixed", "structural", "covariate", "random"),
.width = 1
)
parameter data set output from pmparams::format_param_table.
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").
notes width. Defaults to 1.
Generates specific parameter tables by filtering and using pmtables
This function:
Filters to columns needed for specific parameter tables
Panels by "type"
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.
Attaches notes
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.
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()
} # }