-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME.Rmd
More file actions
115 lines (80 loc) · 2.59 KB
/
Copy pathREADME.Rmd
File metadata and controls
115 lines (80 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = ".",
fig.path = "man/figures/README-",
warning = FALSE,
message = FALSE,
fig.width = 5,
fig.height = 4
)
```
# pmplots <img align="right" src = "man/figures/logo.png" width="135px">
<!-- badges: start -->
<!-- badges: end -->
The goal of pmplots is to create exploratory and diagnostic plots commonly
used in pharmacometrics.
## Installation
You can install the released version of pmplots from [MPN](https://mpn.metworx.com/docs/) with:
```{r, eval = FALSE}
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](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("metrumresearchgroup/pmplots")
```
## Examples
```{r, message = FALSE, warning = FALSE}
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
```{r, dv_pred}
dv_pred(data, yname = "MyDrug (ng/ml)")
```
```{r, dv_pred_log}
dv_pred(data, loglog = TRUE)
```
## NPDE plots
```{r, npde_time}
npde_time(data)
```
```{r, npde_pred}
npde_pred(data)
```
## QQ plots
```{r, cwres_q}
cwres_q(data)
```
## Exploratory plots
```{r, cont_cat, fig.height = 5, fig.width = 7}
id <- pmplots_data_id()
cont_cat(id, x = "STUDYc", y = c("WT", "SCR", "AAG")) %>% pm_grid()
```
```{r, pairs, fig.width = 4.5, fig.width = 6}
pairs_plot(id, y = c("WT//Weight (kg)", "SCR//Creat (mg/dL)", "BMI//BMI (kg/m2)"))
```
## Some faceted versions
```{r, facet_example, fig.height = 5, fig.width = 7}
wrap_cont_time(data, y = c("RES","WRES", "CWRES", "NPDE"), ncol = 2)
```
# Function and workflow overview
A functions and features (code + output) listing is available at
[pmplots_complete.md](https://github.com/metrumresearchgroup/pmplots/blob/master/inst/examples/pmplots_complete.md).
# Suggested packages
Consider installing the [cowplot](https://CRAN.R-project.org/package=cowplot)
package to help arranging plots on a page. Also, consider installing
[latex2exp](https://CRAN.R-project.org/package=latex2exp) to allow you to
use latex in axis titles.