Skip to content

Commit

Permalink
Merge pull request #147 from guiastrennec/master
Browse files Browse the repository at this point in the history
update dev to 0.4.4
  • Loading branch information
Benjamin authored Mar 18, 2019
2 parents 8b36351 + 735bb76 commit c15d1b3
Show file tree
Hide file tree
Showing 696 changed files with 9,932 additions and 12,391 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
^_config\.yml$
^_pkgdown\.yml$
^.*\.Rproj$
^\.github$
^\.Rprofile$
^\.Rproj\.user$
^\.travis\.yml$
Expand Down
6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/
6 changes: 3 additions & 3 deletions CONTRIBUTING.md → .github/CONTRIBUTING.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We are happy that you are willing to help us out with the development of xpose.

## Submitting issues

Before posting a new issue, please check that it has not already been posted nor is listed in our [road-map](https://github.com/UUPharmacometrics/xpose/blob/master/ROADMAP.md).
Before posting a new issue, please check that it has not already been posted.

* For **feature requests** make sure to include sufficient information, such as a proposed workflow, plots images, links to posters or publications describing a method, etc.
* For **reporting a bug**, the most important thing is to include a minimal reproducible example so that we can quickly verify your problem, and figure out how to fix it. To make your example reproducible:
Expand All @@ -18,14 +18,14 @@ Before posting a new issue, please check that it has not already been posted nor

To contribute code to xpose please carefully follow the steps listed below.

*Note 1: before getting started with a pull request, we strongly encourage you follow the procedure described above for **feature requests** and/or **reporting a bug** to ensure that your project is compatible with the our xpose [road-map](https://github.com/UUPharmacometrics/xpose/blob/master/ROADMAP.md).*
*Note 1: before getting started with a pull request, we strongly encourage you follow the procedure described above for **feature requests** and/or **reporting a bug** to ensure that your project is compatible with the our xpose road-map.*

*Note 2: if you are unfamiliar with the development of R packages, please take some time to read the [R packages](http://r-pkgs.had.co.nz) book by Hadley Wickham.*

1. [Fork](https://github.com/UUPharmacometrics/xpose/fork) the xpose repository.
1. Make the changes to the code on your fork.

+ Use the [coding style](http://r-pkgs.had.co.nz/style.html) recommended by Hadley Wickham.
+ Use the tidyverse [coding style](https://style.tidyverse.org/).
+ Any new function should have [Roxygen](http://r-pkgs.had.co.nz/man.html) documentation. Internal functions should contain `#' @keywords internal`. Add examples to new functions. Make sure to update the documentation with `devtools::document()` before submitting the pull request.
+ [Tests](http://r-pkgs.had.co.nz/tests.html) should be added under *tests/testthat/* to ensure for proper code coverage.
+ New plots should be created using the generic `xplot_scatter()`, `xplot_distrib()` or `xplot_qq()`. Check for example the code of *R/plot_gof.R* to see how it should be done.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ inst/models
# Built vignettes
vignettes/*.html
vignettes/*.R
.github/*.html

#OSX directories
__MACOSX/
Empty file modified .travis.yml
100644 → 100755
Empty file.
26 changes: 3 additions & 23 deletions DESCRIPTION
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
Package: xpose
Type: Package
Title: Diagnostics for Pharmacometric Models
Version: 0.4.2
Version: 0.4.4
Authors@R: c(
person('Benjamin', 'Guiastrennec',
role = c('aut', 'cre', 'cph'),
email = '[email protected]'),
person('Andrew C.', 'Hooker',
role = c('aut', 'cph'),
email = '[email protected]'),
person('Anna', 'Olofsson',
role = c('aut', 'cph'),
email = '[email protected]'),
person('Sebastian', 'Ueckert',
role = c('aut', 'cph'),
email = '[email protected]'),
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]'),
person('Mike K.', 'Smith',
role = 'ctb',
email = '[email protected]'),
person('Elodie', 'Plan',
role = 'ctb',
email = '[email protected]'),
person('Mats O.', 'Karlsson',
role = c('aut', 'cph'),
email = '[email protected]'),
person('Pharmetheus',
role = 'ctb',
email = '[email protected]'),
person('Pfizer', role = 'ctb'))
email = '[email protected]'))
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
Expand Down Expand Up @@ -73,4 +53,4 @@ BugReports: https://github.com/UUPharmacometrics/xpose/issues
Encoding: UTF-8
LazyData: true
VignetteBuilder: knitr
RoxygenNote: 6.0.1
RoxygenNote: 6.1.1
Empty file modified LICENSE
100644 → 100755
Empty file.
5 changes: 4 additions & 1 deletion NAMESPACE
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export(amt_vs_idv)
export(append_suffix)
export(as.ctime)
export(as.nm.table.list)
export(as.xpdb)
export(as.xpose.plot)
export(as.xpose.theme)
export(check_plot_type)
export(check_problem)
export(check_quo_vars)
Expand Down Expand Up @@ -69,9 +72,9 @@ export(irep)
export(is.formula)
export(is.nm.model)
export(is.nm.table.list)
export(is.xp.theme)
export(is.xpdb)
export(is.xpose.plot)
export(is.xpose.theme)
export(last_data_problem)
export(last_file_method)
export(last_file_problem)
Expand Down
18 changes: 16 additions & 2 deletions NEWS.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# xpose 0.4.4
### General
* Improved documentation for `xpose_data` (@billdenney #99)
* Fixed VPC error in the documentation (@callistosp #130)
* Fixed bug leading to errors when plotting poorly formatted ETA name (@romainfrancois #127)
* Compatibility improvements

# xpose 0.4.3
### General
* Fixed bug in `get_prm()`/`prm_table()` where off diagonal correlations were improperly computed.
* Fixed bug in `print.xpose_data()`where a warning from stringi was returned.
* Fixed multiple bugs introduced by the new versions of tidyverse packages
* Added compatibility to ggplot2 v3.0.0

# xpose 0.4.2
### General
* Address CRAN requests
Expand Down Expand Up @@ -110,7 +124,7 @@
* Proof of concept pre-release around simple goodness-of-fit functions like `dv_vs_ipred()`

### Definition of core functions and workflow
* Defined the `xpose_geom()` core function to specifically direct arguments to [`ggplot2`](http://ggplot2.tidyverse.org) layers
* Defined the `xpose_geom()` core function to specifically direct arguments to [`ggplot2`](https://ggplot2.tidyverse.org) layers
* Defined the concept of template titles
* Define the templates for `xpose_theme()`
* Makes use of the [`tidyverse`](http://tidyverse.org) and pipes `%>%`
* Makes use of the [`tidyverse`](https://tidyverse.org) and pipes `%>%`
Empty file modified R/examples.R
100644 → 100755
Empty file.
20 changes: 17 additions & 3 deletions R/fetch_data.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,27 @@ only_obs <- function(xpdb, .problem, quiet) {
only_distinct <- function(xpdb, .problem, facets, quiet) {
if (is.formula(facets)) facets <- all.vars(facets)
vars <- c(xp_var(xpdb, .problem, type = c('id'))$col[1], facets)
string <- c('Removing duplicated rows based on: ', stringr::str_c(vars, collapse = ', '))


fun <- function(x) {}
body(fun) <- bquote({
msg(.(string), .(quiet))
dplyr::distinct_(.data = x, .dots = .(vars), .keep_all = TRUE)

var_stg <- .(vars)

# Silently remove "variable" when not in the data
if ('variable' %in% var_stg && !'variable' %in% colnames(x)) {
var_stg <- var_stg[-which(var_stg == 'variable')]
}

msg_stg <- c('Removing duplicated rows based on: ',
stringr::str_c(var_stg, collapse = ', '))
msg(msg_stg, .(quiet))

dplyr::distinct_(.data = x, .dots = var_stg, .keep_all = TRUE)
})

fun

}


Expand Down
Empty file modified R/list_nm_tables.R
100644 → 100755
Empty file.
Empty file modified R/manual_import.R
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion R/plot_amt.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ amt_vs_idv <- function(xpdb,
title = 'Compartments amount vs. @x | @run',
subtitle = 'Ofv: @ofv',
caption = '@dir',
tag = NULL,
log = NULL,
facets,
.problem,
Expand Down Expand Up @@ -61,5 +62,5 @@ amt_vs_idv <- function(xpdb,
xscale = check_scales('x', log),
yscale = check_scales('y', log),
title = title, subtitle = subtitle, caption = caption,
plot_name = as.character(match.call()[[1]]))))
tag = tag, plot_name = as.character(match.call()[[1]]))))
}
12 changes: 8 additions & 4 deletions R/plot_distibution.R → R/plot_distribution.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ prm_distrib <- function(xpdb,
title = 'Parameter distribution | @run',
subtitle = 'Based on @nind individuals',
caption = '@dir',
tag = NULL,
log = NULL,
guide = FALSE,
facets,
Expand Down Expand Up @@ -65,7 +66,7 @@ prm_distrib <- function(xpdb,
xscale = check_scales('x', log),
yscale = check_scales('y', log),
title = title, subtitle = subtitle, caption = caption,
plot_name = as.character(match.call()[[1]]), ...)
tag = tag, plot_name = as.character(match.call()[[1]]), ...)
}

#' @rdname distrib_plot
Expand All @@ -77,6 +78,7 @@ eta_distrib <- function(xpdb,
title = 'Eta distribution | @run',
subtitle = 'Based on @nind individuals, Eta shrink: @etashk',
caption = '@dir',
tag = NULL,
log = NULL,
guide = FALSE,
facets,
Expand Down Expand Up @@ -115,7 +117,7 @@ eta_distrib <- function(xpdb,
xscale = check_scales('x', log),
yscale = check_scales('y', log),
title = title, subtitle = subtitle, caption = caption,
plot_name = as.character(match.call()[[1]]), ...)
tag = tag, plot_name = as.character(match.call()[[1]]), ...)
}

#' @param res Only used for \code{res_distrib}. Defines the type of residual to be used. Default is "CWRES".
Expand All @@ -128,6 +130,7 @@ res_distrib <- function(xpdb,
title = '@x distribution | @run',
subtitle = 'Based on @nobs observations',
caption = '@dir',
tag = NULL,
log = NULL,
guide = FALSE,
facets,
Expand Down Expand Up @@ -165,7 +168,7 @@ res_distrib <- function(xpdb,
xscale = check_scales('x', log),
yscale = check_scales('y', log),
title = title, subtitle = subtitle, caption = caption,
plot_name = as.character(match.call()[[1]]), ...)
tag = tag, plot_name = as.character(match.call()[[1]]), ...)
}

#' @rdname distrib_plot
Expand All @@ -177,6 +180,7 @@ cov_distrib <- function(xpdb,
title = 'Continuous covariates distribution | @run',
subtitle = 'Based on @nind individuals',
caption = '@dir',
tag = NULL,
log = NULL,
guide = FALSE,
facets,
Expand Down Expand Up @@ -208,5 +212,5 @@ cov_distrib <- function(xpdb,
xscale = check_scales('x', log),
yscale = check_scales('y', log),
title = title, subtitle = subtitle, caption = caption,
plot_name = as.character(match.call()[[1]]), ...)
tag = tag, plot_name = as.character(match.call()[[1]]), ...)
}
9 changes: 6 additions & 3 deletions R/plot_gof.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#' @param title Plot title. Use \code{NULL} to remove.
#' @param subtitle Plot subtitle. Use \code{NULL} to remove.
#' @param caption Page caption. Use \code{NULL} to remove.
#' @param tag Plot identification tag. Use \code{NULL} to remove.
#' @param log String assigning logarithmic scale to axes, can be either '',
#' 'x', y' or 'xy'.
#' @param guide Enable guide display (e.g. unity line).
Expand Down Expand Up @@ -40,6 +41,7 @@ dv_vs_ipred <- function(xpdb,
title = '@y vs. @x | @run',
subtitle = 'Ofv: @ofv, Eps shrink: @epsshk',
caption = '@dir',
tag = NULL,
log = NULL,
guide = TRUE,
facets,
Expand All @@ -60,8 +62,8 @@ dv_vs_ipred <- function(xpdb,
type = type, guide = guide, facets = facets,
xscale = check_scales('x', log),
yscale = check_scales('y', log),
title = title, subtitle = subtitle, caption = caption,
plot_name = as.character(match.call()[[1]]),
title = title, subtitle = subtitle, caption = caption,
tag = tag, plot_name = as.character(match.call()[[1]]),
guide_slope = 1, ...)
}

Expand All @@ -74,6 +76,7 @@ dv_vs_pred <- function(xpdb,
title = '@y vs. @x | @run',
subtitle = 'Ofv: @ofv',
caption = '@dir',
tag = NULL,
log = NULL,
guide = TRUE,
facets,
Expand All @@ -95,6 +98,6 @@ dv_vs_pred <- function(xpdb,
xscale = check_scales('x', log),
yscale = check_scales('y', log),
title = title, subtitle = subtitle, caption = caption,
plot_name = as.character(match.call()[[1]]),
tag = tag, plot_name = as.character(match.call()[[1]]),
guide_slope = 1, ...)
}
5 changes: 3 additions & 2 deletions R/plot_individuals.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ind_plots <- function(xpdb,
title = 'Individual plots | @run',
subtitle = 'Ofv: @ofv, Eps shrink: @epsshk',
caption = '@dir | Page @page of @lastpage',
tag = NULL,
log = NULL,
facets,
.problem,
Expand Down Expand Up @@ -70,8 +71,8 @@ ind_plots <- function(xpdb,
type = type, facets = facets,
xscale = check_scales('x', log),
yscale = check_scales('y', log),
title = title, subtitle = subtitle, caption = caption,
plot_name = as.character(match.call()[[1]])))) +
title = title, subtitle = subtitle, caption = caption,
tag = tag, plot_name = as.character(match.call()[[1]])))) +
scale_alpha_manual(values = point_alpha) +
scale_color_manual(values = color) +
scale_linetype_manual(values = line_linetype)
Expand Down
14 changes: 8 additions & 6 deletions R/plot_minimization.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ prm_vs_iteration <- function(xpdb,
title = 'Parameter @y vs. @x | @run',
subtitle = 'Method: @method, minimization time: @runtime\nTermination message: @term',
caption = '@dir',
tag = NULL,
log = NULL,
guide = FALSE,
facets,
Expand All @@ -37,8 +38,8 @@ prm_vs_iteration <- function(xpdb,
check_xpdb(xpdb, check = 'files')
if (missing(.problem)) .problem <- last_file_problem(xpdb, 'ext')
if (missing(.subprob)) .subprob <- last_file_subprob(xpdb, 'ext', .problem)
if (missing(.method)) .method <- last_file_method(xpdb, ext = 'ext',
.problem = .problem, .subprob = .subprob)
if (missing(.method)) .method <- last_file_method(xpdb, ext = 'ext',
.problem = .problem, .subprob = .subprob)
check_problem(.problem, .subprob, .method)
if (missing(quiet)) quiet <- xpdb$options$quiet
if (missing(facets)) facets <- 'variable'
Expand All @@ -63,7 +64,7 @@ prm_vs_iteration <- function(xpdb,
xscale = check_scales('x', log),
yscale = check_scales('y', log),
title = title, subtitle = subtitle, caption = caption,
plot_name = as.character(match.call()[[1]]),
tag = tag, plot_name = as.character(match.call()[[1]]),
scales = 'free_y', ...)
}

Expand All @@ -76,6 +77,7 @@ grd_vs_iteration <- function(xpdb,
title = 'Gradient @y vs. @x | @run',
subtitle = 'Method: @method, minimization time: @runtime\nTermination message: @term',
caption = '@dir',
tag = NULL,
log = NULL,
guide = FALSE,
facets,
Expand All @@ -88,8 +90,8 @@ grd_vs_iteration <- function(xpdb,
check_xpdb(xpdb, check = 'files')
if (missing(.problem)) .problem <- last_file_problem(xpdb, 'grd')
if (missing(.subprob)) .subprob <- last_file_subprob(xpdb, 'grd', .problem)
if (missing(.method)) .method <- last_file_method(xpdb, ext = 'grd',
.problem = .problem, .subprob = .subprob)
if (missing(.method)) .method <- last_file_method(xpdb, ext = 'grd',
.problem = .problem, .subprob = .subprob)
check_problem(.problem, .subprob, .method)
if (missing(quiet)) quiet <- xpdb$options$quiet
if (missing(facets)) facets <- 'variable'
Expand All @@ -114,6 +116,6 @@ grd_vs_iteration <- function(xpdb,
xscale = check_scales('x', log),
yscale = check_scales('y', log),
title = title, subtitle = subtitle, caption = caption,
plot_name = as.character(match.call()[[1]]),
tag = tag, plot_name = as.character(match.call()[[1]]),
scales = 'free_y', ...)
}
Loading

0 comments on commit c15d1b3

Please sign in to comment.