Skip to content

Commit

Permalink
Merge pull request #26 from nlmixr2/vpcplot-example
Browse files Browse the repository at this point in the history
Update model in example to use label()
  • Loading branch information
mattfidler authored Jan 11, 2023
2 parents 85b40df + 50b2f64 commit c375df8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Suggests:
Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
24 changes: 12 additions & 12 deletions R/vpcPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' default is the fitted data, (can be retrieved by
#' \code{\link[nlme]{getData}}), but it can be changed by specifying
#' this argument.
#' @param n Number of VPC simulations. By default 100
#' @param n Number of VPC simulations
#' @param idv Name of independent variable. For `vpcPlot()` and
#' `vpcCens()` the default is `"time"` for `vpcPlotTad()` and
#' `vpcCensTad()` this is `"tad"`
Expand All @@ -22,17 +22,13 @@
#' \donttest{
#' one.cmt <- function() {
#' ini({
#' ## You may label each parameter with a comment
#' tka <- 0.45 # Log Ka
#' tcl <- log(c(0, 2.7, 100)) # Log Cl
#' ## This works with interactive models
#' ## You may also label the preceding line with label("label text")
#' tv <- 3.45; label("log V")
#' ## the label("Label name") works with all models
#' tka <- 0.45; label("Ka")
#' tcl <- log(c(0, 2.7, 100)); label("Cl")
#' tv <- 3.45; label("V")
#' eta.ka ~ 0.6
#' eta.cl ~ 0.3
#' eta.v ~ 0.1
#' add.sd <- 0.7
#' add.sd <- 0.7; label("Additive residual error")
#' })
#' model({
#' ka <- exp(tka + eta.ka)
Expand All @@ -42,12 +38,16 @@
#' })
#' }
#'
#' fit <- nlmixr2est::nlmixr(one.cmt, nlmixr2data::theo_sd, est="focei")
#' fit <-
#' nlmixr2est::nlmixr(
#' one.cmt,
#' data = nlmixr2data::theo_sd,
#' est = "focei",
#' control = list(print = 0)
#' )
#'
#' vpcPlot(fit)
#'
#' }
#'
#' @export
vpcPlot <- function(fit, data = NULL, n = 300, bins = "jenks",
n_bins = "auto", bin_mid = "mean",
Expand Down
24 changes: 12 additions & 12 deletions man/vpcPlot.Rd

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

0 comments on commit c375df8

Please sign in to comment.