Skip to content

Commit

Permalink
Merge pull request #39 from metrumresearchgroup/develop
Browse files Browse the repository at this point in the history
release/0.3.3
  • Loading branch information
kylebaron authored Sep 7, 2021
2 parents 17bda76 + a76aba7 commit cc4b4a7
Show file tree
Hide file tree
Showing 287 changed files with 1,315 additions and 18,565 deletions.
6 changes: 3 additions & 3 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ inst/exdata/run102.RDS
^mrglogo\.pdf$
^.*\.tar\.gz$
Makefile
^.*\.html$
inst/img
inst/examples/img/
inst/examples/img
^.*\.Rproj$
^\.Rproj\.user$
^docs$
^\.travis\.yml$
vignettes
\.drone\.yml
_pkgdown\.yml
vignettes/complete\.Rmd
vignettes/*\.pdf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
docs
test.R
inst/examples/*.html
Rplots.pdf
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pmplots
Type: Package
Title: Plots for Pharmacometrics
Version: 0.3.2
Version: 0.3.3
Authors@R: c(
person("Kyle T", "Baron", "", "kyleb@metrumrg.com", c("aut", "cre")),
person("Metrum Research Group", role = c("cph"))
Expand All @@ -14,7 +14,6 @@ URL: https://github.com/metrumresearchgroup/pmplots/
BugReports: https://github.com/metrumresearchgroup/pmplots/issues
Encoding: UTF-8
Language: en-US
LazyData: true
Imports:
dplyr (>= 0.7.2),
rlang (>= 0.1.2),
Expand All @@ -23,7 +22,8 @@ Imports:
tidyr,
purrr,
forcats
Suggests: testthat, GGally, latex2exp, knitr, cowplot, yaml, miniUI, shiny
VignetteBuilder: knitr
Suggests: testthat, GGally, latex2exp, knitr, cowplot, yaml, miniUI, shiny, rmarkdown
Depends: ggplot2 (>= 3.0.0)
RoxygenNote: 7.1.1
Roxygen: list(markdown = TRUE)
Expand Down
24 changes: 14 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ all:
make build
make install

package:
make doc
make build-vignettes
make install

spelling:
Rscript -e "spelling::spell_check_package()"

Expand All @@ -49,6 +54,9 @@ doc:
build:
R CMD build --no-build-vignettes --md5 $(PKGDIR)

build-vignettes:
R CMD build --md5 $(PKGDIR)

install:
R CMD INSTALL --install-tests ${TARBALL}

Expand All @@ -58,16 +66,12 @@ install-build:
check:
make doc
make build
R CMD check ${TARBALL} -o ${CHKDIR}

checkk:
make doc
make build
R CMD check ${TARBALL} -o ${CHKDIR} --no-examples
R CMD check --ignore-vignettes ${TARBALL} -o ${CHKDIR}

testing:
check-package:
make doc
make build
cp ${TARBALL} ../../qualification/pmplots_qualification/testing/${TARBALL}
cd ../../qualification/pmplots_qualification/testing/ && git commit -am "testing update" && git push
make build-vignettes
R CMD check ${TARBALL} -o ${CHKDIR}

readme:
Rscript -e 'rmarkdown::render("README.Rmd")'
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# pmplots 0.3.3

- Add vignettes into package (#37)

- Re-work README (#37)


# pmplots 0.3.2

- `pairs_plot()` and `eta_pairs()` now will properly call user-supplied
Expand Down
115 changes: 115 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,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/metrum_pmplots_git_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.
127 changes: 103 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,116 @@
pmplots
================

## Browse source code at
https://github.com/metrumresearchgroup/pmplots
<!-- README.md is generated from README.Rmd. Please edit that file -->

# pmplots <img align="right" src = "man/figures/metrum_pmplots_git_logo.png" width="135px">

<!-- badges: start -->
<!-- badges: end -->

The goal of pmplots is to create exploratory and diagnostic plots
commonly used in pharmacometrics.

## Installation

TODO(devin) pmplots is available on MPN
You can install the released version of pmplots from
[MPN](https://mpn.metworx.com/docs/) with:

``` r
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
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(data, yname = "MyDrug (ng/ml)")
```

![](man/figures/README-dv_pred-1.png)<!-- -->

``` r
dv_pred(data, loglog = TRUE)
```

![](man/figures/README-dv_pred_log-1.png)<!-- -->

## NPDE plots

``` r
npde_time(data)
```

![](man/figures/README-npde_time-1.png)<!-- -->

``` r
npde_pred(data)
```

![](man/figures/README-npde_pred-1.png)<!-- -->

## QQ plots

``` r
cwres_q(data)
```

![](man/figures/README-cwres_q-1.png)<!-- -->

## Exploratory plots

``` r
id <- pmplots_data_id()
cont_cat(id, x = "STUDYc", y = c("WT", "SCR", "AAG")) %>% pm_grid()
```

![](man/figures/README-cont_cat-1.png)<!-- -->

## News
``` r
pairs_plot(id, y = c("WT//Weight (kg)", "SCR//Creat (mg/dL)", "BMI//BMI (kg/m2)"))
```

News can be found [here](news.md)
![](man/figures/README-pairs-1.png)<!-- -->

## Function and workflow overview
## Some faceted versions

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).
``` r
wrap_cont_time(data, y = c("RES","WRES", "CWRES", "NPDE"), ncol = 2)
```

## Vignettes
![](man/figures/README-facet_example-1.png)<!-- -->

- [Get started](https://metrumresearchgroup.github.io/pmplots/articles/start.html)
- [Customize your plot](https://metrumresearchgroup.github.io/pmplots/articles/customize.html)
- [Residual plots](https://metrumresearchgroup.github.io/pmplots/articles/residual_plots.html)
- [NPDE plots](https://metrumresearchgroup.github.io/pmplots/articles/npde_plots.html)
- [Dependent variable plots](https://metrumresearchgroup.github.io/pmplots/articles/dv.html)
- [ETA plots](https://metrumresearchgroup.github.io/pmplots/articles/eta.html)
- [Vectorized plots](https://metrumresearchgroup.github.io/pmplots/articles/list_plots.html)
- [Wrapped or faceted plots](https://metrumresearchgroup.github.io/pmplots/articles/wrapped_plots.html)
# Function and workflow overview

## Suggested packages
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).

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.
# 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.
7 changes: 5 additions & 2 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
development:
mode: auto
title: pmplots
navbar:
right:
- icon: fa-github fa-lg
href: https://github.com/metrumresearchgroup/pmplots
Loading

0 comments on commit cc4b4a7

Please sign in to comment.