aboutsummaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-11-09 16:33:19 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2020-11-09 16:33:19 +0100
commita1631098acfc3352e19c331e568bd6f5766b3c3d (patch)
tree6475ead3d4a0f6e754426d713514b594cefadb73 /man
parent6464d3999338d34c081f360694dbc0bc0abf68cb (diff)
Merge plot methods for nlme.mmkin and saem.mmkin
This avoids code duplication
Diffstat (limited to 'man')
-rw-r--r--man/plot.saem.mmkin.Rd94
-rw-r--r--man/plot_mixed.Rd (renamed from man/plot.nlme.mmkin.Rd)45
-rw-r--r--man/reexports.Rd5
3 files changed, 41 insertions, 103 deletions
diff --git a/man/plot.saem.mmkin.Rd b/man/plot.saem.mmkin.Rd
deleted file mode 100644
index 1f674bd7..00000000
--- a/man/plot.saem.mmkin.Rd
+++ /dev/null
@@ -1,94 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/plot.saem.mmkin.R
-\name{plot.saem.mmkin}
-\alias{plot.saem.mmkin}
-\title{Plot an saem fitted nonlinear mixed model obtained via an mmkin row object}
-\usage{
-\method{plot}{saem.mmkin}(
- x,
- i = 1:ncol(x$mmkin),
- obs_vars = names(x$mkinmod$map),
- standardized = TRUE,
- xlab = "Time",
- xlim = range(x$data$time),
- resplot = c("predicted", "time"),
- ymax = "auto",
- maxabs = "auto",
- ncol.legend = ifelse(length(i) <= 3, length(i) + 1, ifelse(length(i) <= 8, 3, 4)),
- nrow.legend = ceiling((length(i) + 1)/ncol.legend),
- rel.height.legend = 0.03 + 0.08 * nrow.legend,
- rel.height.bottom = 1.1,
- pch_ds = 1:length(i),
- col_ds = pch_ds + 1,
- lty_ds = col_ds,
- frame = TRUE,
- ...
-)
-}
-\arguments{
-\item{x}{An object of class \code{\link{saem.mmkin}}}
-
-\item{i}{A numeric index to select datasets for which to plot the saem fit,
-in case plots get too large}
-
-\item{obs_vars}{A character vector of names of the observed variables for
-which the data and the model should be plotted. Defauls to all observed
-variables in the model.}
-
-\item{standardized}{Should the residuals be standardized? Only takes effect if
-\code{resplot = "time"}.}
-
-\item{xlab}{Label for the x axis.}
-
-\item{xlim}{Plot range in x direction.}
-
-\item{resplot}{Should the residuals plotted against time or against
-predicted values?}
-
-\item{ymax}{Vector of maximum y axis values}
-
-\item{maxabs}{Maximum absolute value of the residuals. This is used for the
-scaling of the y axis and defaults to "auto".}
-
-\item{ncol.legend}{Number of columns to use in the legend}
-
-\item{nrow.legend}{Number of rows to use in the legend}
-
-\item{rel.height.legend}{The relative height of the legend shown on top}
-
-\item{rel.height.bottom}{The relative height of the bottom plot row}
-
-\item{pch_ds}{Symbols to be used for plotting the data.}
-
-\item{col_ds}{Colors used for plotting the observed data and the
-corresponding model prediction lines for the different datasets.}
-
-\item{lty_ds}{Line types to be used for the model predictions.}
-
-\item{frame}{Should a frame be drawn around the plots?}
-
-\item{...}{Further arguments passed to \code{\link{plot}}.}
-}
-\value{
-The function is called for its side effect.
-}
-\description{
-Plot an saem fitted nonlinear mixed model obtained via an mmkin row object
-}
-\examples{
-ds <- lapply(experimental_data_for_UBA_2019[6:10],
- function(x) x$data[c("name", "time", "value")])
-names(ds) <- paste0("ds ", 6:10)
-dfop_sfo <- mkinmod(parent = mkinsub("DFOP", "A1"),
- A1 = mkinsub("SFO"), quiet = TRUE)
-\dontrun{
-f <- mmkin(list("DFOP-SFO" = dfop_sfo), ds, quiet = TRUE)
-plot(f[, 3:4], standardized = TRUE)
-
-f_saem <- saem(f)
-plot(f_saem)
-}
-}
-\author{
-Johannes Ranke
-}
diff --git a/man/plot.nlme.mmkin.Rd b/man/plot_mixed.Rd
index f426f77b..d3cee7c9 100644
--- a/man/plot.nlme.mmkin.Rd
+++ b/man/plot_mixed.Rd
@@ -1,9 +1,32 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/plot.nlme.mmkin.R
-\name{plot.nlme.mmkin}
+% Please edit documentation in R/plot_mixed.R
+\name{plot_mixed}
+\alias{plot_mixed}
+\alias{plot.saem.mmkin}
\alias{plot.nlme.mmkin}
-\title{Plot a fitted nonlinear mixed model obtained via an mmkin row object}
+\title{Plot predictions from a fitted nonlinear mixed model obtained via an mmkin row object}
\usage{
+\method{plot}{saem.mmkin}(
+ x,
+ i = 1:ncol(x$mmkin),
+ obs_vars = names(x$mkinmod$map),
+ standardized = TRUE,
+ xlab = "Time",
+ xlim = range(x$data$time),
+ resplot = c("predicted", "time"),
+ ymax = "auto",
+ maxabs = "auto",
+ ncol.legend = ifelse(length(i) <= 3, length(i) + 1, ifelse(length(i) <= 8, 3, 4)),
+ nrow.legend = ceiling((length(i) + 1)/ncol.legend),
+ rel.height.legend = 0.03 + 0.08 * nrow.legend,
+ rel.height.bottom = 1.1,
+ pch_ds = 1:length(i),
+ col_ds = pch_ds + 1,
+ lty_ds = col_ds,
+ frame = TRUE,
+ ...
+)
+
\method{plot}{nlme.mmkin}(
x,
i = 1:ncol(x$mmkin),
@@ -21,13 +44,14 @@
pch_ds = 1:length(i),
col_ds = pch_ds + 1,
lty_ds = col_ds,
- frame = TRUE
+ frame = TRUE,
+ ...
)
}
\arguments{
-\item{x}{An object of class \code{\link{nlme.mmkin}}}
+\item{x}{An object of class \link{saem.mmkin} or \link{nlme.mmkin}}
-\item{i}{A numeric index to select datasets for which to plot the nlme fit,
+\item{i}{A numeric index to select datasets for which to plot the individual predictions,
in case plots get too large}
\item{obs_vars}{A character vector of names of the observed variables for
@@ -65,12 +89,14 @@ corresponding model prediction lines for the different datasets.}
\item{lty_ds}{Line types to be used for the model predictions.}
\item{frame}{Should a frame be drawn around the plots?}
+
+\item{...}{Further arguments passed to \code{\link{plot}}.}
}
\value{
-The function is called for its side effect.
+The functions are called for their side effect.
}
\description{
-Plot a fitted nonlinear mixed model obtained via an mmkin row object
+Plot predictions from a fitted nonlinear mixed model obtained via an mmkin row object
}
\examples{
ds <- lapply(experimental_data_for_UBA_2019[6:10],
@@ -87,6 +113,9 @@ library(nlme)
# tolerance in order to speed up the fit for this example evaluation
f_nlme <- nlme(f, control = list(pnlsMaxIter = 120, tolerance = 1e-3))
plot(f_nlme)
+
+f_saem <- saem(f)
+plot(f_saem)
}
}
\author{
diff --git a/man/reexports.Rd b/man/reexports.Rd
index bb77acc5..ccba7567 100644
--- a/man/reexports.Rd
+++ b/man/reexports.Rd
@@ -1,9 +1,10 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/lrtest.mkinfit.R
+% Please edit documentation in R/lrtest.mkinfit.R, R/nlme.mmkin.R
\docType{import}
\name{reexports}
\alias{reexports}
\alias{lrtest}
+\alias{nlme}
\title{Objects exported from other packages}
\keyword{internal}
\description{
@@ -12,5 +13,7 @@ below to see their documentation.
\describe{
\item{lmtest}{\code{\link[lmtest]{lrtest}}}
+
+ \item{nlme}{\code{\link[nlme]{nlme}}}
}}

Contact - Imprint