knitr::opts_chunk$set( collapse = TRUE, comment = ".", fig.path = "man/figures/README-", warning = FALSE, message = FALSE, fig.width = 5, fig.height = 4 )
The goal of pmplots is to create exploratory and diagnostic plots commonly used in pharmacometrics.
You can install the released version of pmplots from MPN with:
mpn <- "https://mpn.metworx.com/snapshots/stable/2021-06-20" install.packages("pmplots", repos = mpn)
This installs from a specific, dated snapshot. Please check https://mpn.metworx.com/docs/snapshots/ for the most recent snapshot date.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("metrumresearchgroup/pmplots")
library(pmplots) library(dplyr) data <- pmplots_data_obs()
The default pmplots behavior is to expect names following NONMEM convention,
for example DV
refers to observed values, PRED
refers to population
predicted values. With that convention, we can easily make observed versus
predicted plots
dv_pred(data, yname = "MyDrug (ng/ml)")
dv_pred(data, loglog = TRUE)
npde_time(data)
npde_pred(data)
cwres_q(data)
id <- pmplots_data_id() cont_cat(id, x = "STUDYc", y = c("WT", "SCR", "AAG")) %>% pm_grid()
pairs_plot(id, y = c("WT//Weight (kg)", "SCR//Creat (mg/dL)", "BMI//BMI (kg/m2)"))
wrap_cont_time(data, y = c("RES","WRES", "CWRES", "NPDE"), ncol = 2)
A functions and features (code + output) listing is available at pmplots_complete.md.
Consider installing the cowplot package to help arranging plots on a page. Also, consider installing latex2exp to allow you to use latex in axis titles.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.