From 2ded0424ba1a2ad6d6e265dd785b9c5f54d53319 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 19 Oct 2015 16:10:34 +0200 Subject: Add the R6 class mkinds --- DESCRIPTION | 2 +- NAMESPACE | 1 + NEWS.md | 6 ++++-- R/mkinds.R | 2 +- inst/examples/mkinds.R | 1 + man/mkinds.Rd | 34 ++++++++++++++++++++++++++++++++++ man/print.mkinds.Rd | 19 +++++++++++++++++++ 7 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 inst/examples/mkinds.R create mode 100644 man/mkinds.Rd create mode 100644 man/print.mkinds.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 8aba93d1..8809b02d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,7 +18,7 @@ Description: Calculation routines based on the FOCUS Kinetics Report (2006). Please note that no warranty is implied for correctness of results or fitness for a particular purpose. Depends: minpack.lm, rootSolve, inline, parallel -Imports: stats, graphics, methods, FME, deSolve +Imports: stats, graphics, methods, FME, deSolve, R6 Suggests: knitr, testthat, microbenchmark License: GPL LazyLoad: yes diff --git a/NAMESPACE b/NAMESPACE index 87d27717..a37bad8c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -18,3 +18,4 @@ import( ) importFrom(deSolve, ode) importFrom(methods, signature) +importFrom(R6, R6Class) diff --git a/NEWS.md b/NEWS.md index 1f0fdab7..e2b98d91 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,12 +4,14 @@ ### Minor changes +- Add an R6 class `mkinds` representing datasets with a printing method + +- Add a printing method for mkinmod objects + - Make it possible to specify arbitrary strings as names for the compounds in `mkinmod`, and show them in the plot - Use an index.r file to group help topics in static documentation -- Add a printing method for mkinmod objects - ## mkin 0.9-40 (2015-07-21) ### Bug fixes diff --git a/R/mkinds.R b/R/mkinds.R index 17d40875..b86751fb 100644 --- a/R/mkinds.R +++ b/R/mkinds.R @@ -30,7 +30,7 @@ #' @field replicates The number of replicates #' @field data A dataframe with at least the columns name, time and value #' in order to be compatible with mkinfit -#' @examples inst/examples/mkinds.R +#' @example inst/examples/mkinds.R mkinds <- R6Class("mkinds", public = list( title = NULL, diff --git a/inst/examples/mkinds.R b/inst/examples/mkinds.R new file mode 100644 index 00000000..6c5d2cfc --- /dev/null +++ b/inst/examples/mkinds.R @@ -0,0 +1 @@ +mds <- mkinds$new("FOCUS A", FOCUS_2006_A) diff --git a/man/mkinds.Rd b/man/mkinds.Rd new file mode 100644 index 00000000..239ab328 --- /dev/null +++ b/man/mkinds.Rd @@ -0,0 +1,34 @@ +\docType{class} +\name{mkinds} +\alias{mkinds} +\title{A dataset class for mkin} +\format{An \code{\link{R6Class}} generator object.} +\usage{ +mkinds +} +\description{ +A dataset class for mkin +} +\section{Fields}{ + +\describe{ +\item{\code{title}}{A full title for the dataset} + +\item{\code{sampling}}{times The sampling times} + +\item{\code{time_unit}}{The time unit} + +\item{\code{observed}}{Names of the observed compounds} + +\item{\code{unit}}{The unit of the observations} + +\item{\code{replicates}}{The number of replicates} + +\item{\code{data}}{A dataframe with at least the columns name, time and value +in order to be compatible with mkinfit} +}} +\examples{ +mds <- mkinds$new("FOCUS A", FOCUS_2006_A) +} +\keyword{datasets} + diff --git a/man/print.mkinds.Rd b/man/print.mkinds.Rd new file mode 100644 index 00000000..e7acf30d --- /dev/null +++ b/man/print.mkinds.Rd @@ -0,0 +1,19 @@ +\name{print.mkinds} +\alias{print.mkinds} +\title{ + Print mkinds objects +} +\description{ + Print mkinds objects. +} +\usage{ +\method{print}{mkinds}(x, ...) +} +\arguments{ + \item{x}{ + An \code{\link{mkinds}} object. + } + \item{\dots}{ + Not used. + } +} -- cgit v1.2.1