Skip to content

Commit

Permalink
Merge pull request #69 from UUPharmacometrics/dev
Browse files Browse the repository at this point in the history
Update Master to 0.4.0
  • Loading branch information
Benjamin authored Nov 17, 2017
2 parents d6d6238 + e029025 commit 05486f0
Show file tree
Hide file tree
Showing 46 changed files with 146 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
^_pkgdown\.yml$
^.*\.Rproj$
^\.Rproj\.user$
^logo\.png$
^LICENSE$
^README\.Rmd$
^temporary$
^inst/models$
Expand Down
14 changes: 11 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: xpose
Type: Package
Title: Diagnostics for pharmacometric models
Title: Diagnostics for Pharmacometric Models
Version: 0.4.0
Authors@R: c(
person('Benjamin', 'Guiastrennec',
Expand All @@ -18,6 +18,10 @@ Authors@R: c(
person('Ron', 'Keizer',
role = 'aut',
email = '[email protected]'),
person('Nick', 'Solomon',
role = 'ctb',
comment = 'Wrote the geom_qq_line function',
email = '[email protected]'),
person('Kajsa', 'Harling',
role = 'ctb',
email = '[email protected]'),
Expand All @@ -34,7 +38,11 @@ Authors@R: c(
role = 'ctb',
email = '[email protected]'),
person('Pfizer', role = 'ctb'))
Description: Automated generation of graphical diagnostics for non-linear mixed effect models.
Description: Diagnostics for non-linear mixed-effects (population)
models from 'NONMEM' <http://www.iconplc.com/innovation/nonmem/>.
'xpose' facilitates data import, creation of numerical run summary
and provide 'ggplot2'-based graphics for data exploration and model
diagnostics.
Depends:
R (>= 3.1.2),
ggplot2 (>= 2.2.1)
Expand All @@ -59,7 +67,7 @@ Suggests:
plotly,
webshot,
mvtnorm
License: LGPL-3 + file LICENSE
License: LGPL-3
URL: https://github.com/UUPharmacometrics/xpose
BugReports: https://github.com/UUPharmacometrics/xpose/issues
Encoding: UTF-8
Expand Down
25 changes: 12 additions & 13 deletions R/xpose_save.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#' Save xpose plot
#'
#' @description Automatically save xpose plots to files.
#'
#' This function was inspired by the \link[ggplot2]{ggsave}. If no arguments are provided,
#' the function will automatically name and save a plot after its run number and the plotting
#' function name by using the metadata attached to the plot.
#' @description Inspired by the \link[ggplot2]{ggsave}, this function
#' facilitates the export of xpose plots.
#'
#' @param plot A xpose plot object.
#' @param file An optional name to be given to the file. Template variables such as @run
#' can be used to generate template names.
#' @param dir Directory under which the xpose plot will be saved. Template variables such as @dir
#' can be used to generate template names.
#' @param file A name with file extension (if device is \code{NULL}) to be given to the
#' output file. Template variables such as \code{@run} (run number) and \code{@plotfun}
#' (plot function) can be used to automatically name files e.g.
#' \code{file = '@[email protected]'}.
#' @param dir Directory under which the xpose plots will be saved. Template variables
#' such as \code{@dir} can be used to generate template names.
#' @param device Graphical device to use. Can be either be a device function
#' (e.g. \code{\link{png}}), or one of 'eps', 'ps', 'tex' (pictex),
#' 'pdf' (default), 'jpeg', 'tiff', 'png', 'bmp', 'svg' or 'wmf' (windows only).
Expand All @@ -23,11 +22,11 @@
#' \dontrun{
#' xpdb_ex_pk %>%
#' dv_vs_ipred() %>%
#' xpose_save()
#' xpose_save(file = file.path(tempdir(), "dv_vs_ipred_example.pdf"))
#' }
#' @export
xpose_save <- function(plot = last_plot(),
file = '@[email protected]',
file = NULL,
dir = NULL,
device = NULL,
width = 7,
Expand All @@ -37,9 +36,9 @@ xpose_save <- function(plot = last_plot(),
...) {

if (is.null(plot)) {
stop('The `plot` argument is NULL.')
stop('Argument `plot` required.', call. = FALSE)
} else if (is.null(file)) {
stop('The `file` argument is NULL.')
stop('Argument `file` required.', call. = FALSE)
}

# Parse the dir and file arguments for keywords
Expand Down
23 changes: 13 additions & 10 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@
output: github_document
---

# xpose <a href="https://UUPharmacometrics.github.io/xpose/"><img src="logo.png" align="right" /></a>

[![travis_status](https://travis-ci.org/UUPharmacometrics/xpose.svg?branch=master)](https://travis-ci.org/UUPharmacometrics/xpose)
[![appveyor status](https://ci.appveyor.com/api/projects/status/f6k09rf2cfi3vcs2?svg=true)](https://ci.appveyor.com/project/guiastrennec/xpose)[![cran_version](http://www.r-pkg.org/badges/version/xpose)]()
[![codecov](https://codecov.io/gh/UUPharmacometrics/xpose/branch/master/graph/badge.svg)](https://codecov.io/gh/UUPharmacometrics/xpose)
<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r, include = FALSE}
library(xpose)
xpdb <- xpdb_ex_pk
xpdb$options$quiet <- TRUE
knitr::opts_chunk$set(fig.path = 'inst/img/',
fig.dpi = 96,
knitr::opts_chunk$set(fig.path = 'man/figures/',
fig.dpi = 96,
fig.height = 4,
fig.width = 4,
out.width = '50%',
fig.align = 'center')
fig.width = 4,
out.width = '50%',
fig.align = 'center')
```

# xpose <a href="https://UUPharmacometrics.github.io/xpose/"><img src="man/figures/logo.png" align="right" /></a>

[![travis_status](https://travis-ci.org/UUPharmacometrics/xpose.svg?branch=master)](https://travis-ci.org/UUPharmacometrics/xpose)
[![appveyor status](https://ci.appveyor.com/api/projects/status/f6k09rf2cfi3vcs2?svg=true)](https://ci.appveyor.com/project/guiastrennec/xpose)[![cran_version](http://www.r-pkg.org/badges/version/xpose)]()
[![codecov](https://codecov.io/gh/UUPharmacometrics/xpose/branch/master/graph/badge.svg)](https://codecov.io/gh/UUPharmacometrics/xpose)


### Overview
[xpose](https://UUPharmacometrics.github.io/xpose/) was designed as a [ggplot2](https://github.com/tidyverse/ggplot2)-based alternative to [xpose4](http://xpose.sourceforge.net). xpose aims to reduce the post processing burden and improve diagnostics commonly associated the development of non-linear mixed effect models.

Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

xpose <a href="https://UUPharmacometrics.github.io/xpose/"><img src="logo.png" align="right" /></a>
===================================================================================================
<!-- README.md is generated from README.Rmd. Please edit that file -->
xpose <a href="https://UUPharmacometrics.github.io/xpose/"><img src="man/figures/logo.png" align="right" /></a>
===============================================================================================================

[![travis\_status](https://travis-ci.org/UUPharmacometrics/xpose.svg?branch=master)](https://travis-ci.org/UUPharmacometrics/xpose) [![appveyor status](https://ci.appveyor.com/api/projects/status/f6k09rf2cfi3vcs2?svg=true)](https://ci.appveyor.com/project/guiastrennec/xpose)[![cran\_version](http://www.r-pkg.org/badges/version/xpose)]() [![codecov](https://codecov.io/gh/UUPharmacometrics/xpose/branch/master/graph/badge.svg)](https://codecov.io/gh/UUPharmacometrics/xpose)

Expand Down Expand Up @@ -100,15 +101,15 @@ summary(xpdb, problem = 1)
dv_vs_ipred(xpdb)
```

<img src="inst/img/readme_example_figure_1-1.png" width="50%" style="display: block; margin: auto;" />
<img src="man/figures/readme_example_figure_1-1.png" width="50%" style="display: block; margin: auto;" />

##### Individual plots

``` r
ind_plots(xpdb, page = 1)
```

<img src="inst/img/readme_example_figure_2-1.png" width="75%" style="display: block; margin: auto;" />
<img src="man/figures/readme_example_figure_2-1.png" width="75%" style="display: block; margin: auto;" />

##### Visual predictive checks

Expand All @@ -118,23 +119,23 @@ xpdb %>%
vpc()
```

<img src="inst/img/readme_example_figure_3-1.png" width="75%" style="display: block; margin: auto;" />
<img src="man/figures/readme_example_figure_3-1.png" width="75%" style="display: block; margin: auto;" />

##### Distribution plots

``` r
eta_distrib(xpdb, labeller = 'label_value')
```

<img src="inst/img/readme_example_figure_4-1.png" width="75%" style="display: block; margin: auto;" />
<img src="man/figures/readme_example_figure_4-1.png" width="75%" style="display: block; margin: auto;" />

##### Minimization diagnostics

``` r
prm_vs_iteration(xpdb, labeller = 'label_value')
```

<img src="inst/img/readme_example_figure_5-1.png" width="75%" style="display: block; margin: auto;" />
<img src="man/figures/readme_example_figure_5-1.png" width="75%" style="display: block; margin: auto;" />

##### And many other features!

Expand Down
2 changes: 1 addition & 1 deletion docs/articles/about.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/access_xpdb_data.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/bestiarium.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/articles/cheatsheet.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/articles/customize_plots.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/faq.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/import_model_outputs.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions docs/articles/interactive_plots.html

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions docs/articles/introduction.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ list_vars(xpdb)
## ---- eval = FALSE-------------------------------------------------------
# xpose_data(runno = '001') %>%
# dv_vs_ipred() %>%
# xpose_save()
# xpose_save(file = 'run001_dv_vs_ipred.pdf')

## ---- change idv---------------------------------------------------------
# With the TIME default
Expand All @@ -47,9 +47,12 @@ dv_vs_ipred(xpdb)
res_vs_pred(xpdb, res = 'CWRES')

## ---- eval = FALSE-------------------------------------------------------
# # Save the last plot
# xpose_save()
# # Save the last generated plot
# dv_vs_ipred(xpdb)
# xpose_save(file = 'run001_dv_vs_ipred.pdf')
#
# # Change file name and extension
# xpose_save(file = '@run_@plotfun_[@ofv].jpeg', dir = 'pk/diagnostics')
# # Template titles can also be used in filename and the directory
# xpdb %>%
# dv_vs_ipred() %>%
# xpose_save(file = '@run_@plotfun_[@ofv].jpeg', dir = '@dir')

18 changes: 11 additions & 7 deletions docs/articles/introduction.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/multiple_pages.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dv_vs_ipred(xpdb_numbered, facets = c('SEX', 'MED1'), ncol = 2, nrow = 1, page =

## ---- eval = FALSE--------------------------------------------------------------------------------
# dv_vs_ipred(xpdb_numbered, facets = c('SEX', 'MED1'), ncol = 2, nrow = 1) %>%
# xpose_save()
# xpose_save(file = 'dv_vs_ipred_multiple.pdf')

## ---- eval = FALSE--------------------------------------------------------------------------------
# dv_vs_ipred(xpdb_numbered, facets = c('SEX', 'MED1'), ncol = 2, nrow = 1) %>%
Expand Down
6 changes: 3 additions & 3 deletions docs/articles/multiple_pages.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/vpc.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 05486f0

Please sign in to comment.