From 59b3d5f9ec44de16be1ea94c1bfda22e2d794bd8 Mon Sep 17 00:00:00 2001 From: Eliot McIntire Date: Thu, 13 Sep 2018 21:54:26 -0700 Subject: [PATCH] redoc --- R/simList-accessors.R | 82 +++++++++++++++---------------- man/addDepends.Rd | 14 +++--- man/checkpoint.Rd | 4 +- man/globals.Rd | 4 +- man/ls-method.Rd | 4 +- man/ls_str-method.Rd | 4 +- man/objects.Rd | 4 +- man/packages.Rd | 4 +- man/params.Rd | 4 +- man/progress.Rd | 4 +- man/simList-accessors-envir.Rd | 4 +- man/simList-accessors-events.Rd | 4 +- man/simList-accessors-inout.Rd | 4 +- man/simList-accessors-metadata.Rd | 34 ++++++------- man/simList-accessors-modules.Rd | 4 +- man/simList-accessors-paths.Rd | 24 +-------- man/simList-accessors-times.Rd | 4 +- 17 files changed, 92 insertions(+), 114 deletions(-) diff --git a/R/simList-accessors.R b/R/simList-accessors.R index 0f9343390..6114c0d4e 100644 --- a/R/simList-accessors.R +++ b/R/simList-accessors.R @@ -1575,47 +1575,6 @@ setReplaceMethod( }) -################################################################################ -#' @param package For compatibility with \code{\link[utils]{citation}}. This can be -#' a \code{simList} or a character string for a package name. -#' @inheritParams P -#' @inheritParams utils::citation -#' @include simList-class.R -#' @export -#' @rdname simList-accessors-metadata -#' -setGeneric("citation", function(package, lib.loc = NULL, auto = NULL, module = character()) { - standardGeneric("citation") -}) - -#' @export -#' @rdname simList-accessors-metadata -setMethod("citation", - signature = ".simList", - definition = function(package, lib.loc, auto, module) { - if (missing(module)) { - module <- current(package) - if (NROW(module) == 0) - module <- unlist(modules(package)) - } - out <- if (length(module) > 1) { - lapply(package@depends@dependencies[module], function(deps) - deps@citation) - } else { - package@depends@dependencies[[module]]@citation - } - return(out) - }) - -#' @export -#' @rdname simList-accessors-metadata -setMethod("citation", - signature = "character", - definition = function(package, lib.loc, auto, module) { - utils::citation(package = package, lib.loc = lib.loc, auto = auto) - }) - - ################################################################################ #' Specify paths for modules, inputs, and outputs @@ -2821,3 +2780,44 @@ setMethod("documentation", }) +################################################################################ +#' @param package For compatibility with \code{\link[utils]{citation}}. This can be +#' a \code{simList} or a character string for a package name. +#' @inheritParams P +#' @inheritParams utils::citation +#' @include simList-class.R +#' @export +#' @rdname simList-accessors-metadata +#' +setGeneric("citation", function(package, lib.loc = NULL, auto = NULL, module = character()) { + standardGeneric("citation") +}) + +#' @export +#' @rdname simList-accessors-metadata +setMethod("citation", + signature = ".simList", + definition = function(package, lib.loc, auto, module) { + if (missing(module)) { + module <- current(package) + if (NROW(module) == 0) + module <- unlist(modules(package)) + } + out <- if (length(module) > 1) { + lapply(package@depends@dependencies[module], function(deps) + deps@citation) + } else { + package@depends@dependencies[[module]]@citation + } + return(out) + }) + +#' @export +#' @rdname simList-accessors-metadata +setMethod("citation", + signature = "character", + definition = function(package, lib.loc, auto, module) { + utils::citation(package = package, lib.loc = lib.loc, auto = auto) + }) + + diff --git a/man/addDepends.Rd b/man/addDepends.Rd index 71e72ac29..d3fab1aa9 100644 --- a/man/addDepends.Rd +++ b/man/addDepends.Rd @@ -25,13 +25,13 @@ Internal function. Adds a \code{\link{.moduleDeps}} object to the simulation dependency list. } \seealso{ -Other functions to access elements of a \code{simList} object: \code{\link{citation,.simList-method}}, - \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, - \code{\link{events}}, \code{\link{globals}}, - \code{\link{inputs}}, \code{\link{ls.simList}}, - \code{\link{ls.str.simList}}, \code{\link{modules}}, - \code{\link{objs}}, \code{\link{packages}}, - \code{\link{params}}, \code{\link{progressInterval}}, +Other functions to access elements of a \code{simList} object: \code{\link{doEvent.checkpoint}}, + \code{\link{envir}}, \code{\link{events}}, + \code{\link{globals}}, \code{\link{inputs}}, + \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, + \code{\link{modules}}, \code{\link{objs}}, + \code{\link{packages}}, \code{\link{params}}, + \code{\link{paths}}, \code{\link{progressInterval}}, \code{\link{times}} } \author{ diff --git a/man/checkpoint.Rd b/man/checkpoint.Rd index dab30c948..9df8dbe8e 100644 --- a/man/checkpoint.Rd +++ b/man/checkpoint.Rd @@ -69,13 +69,13 @@ and \url{https://stackoverflow.com/questions/13997444/} \code{\link{.Random.seed}}. Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{envir}}, \code{\link{events}}, \code{\link{globals}}, \code{\link{inputs}}, \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, \code{\link{modules}}, \code{\link{objs}}, \code{\link{packages}}, \code{\link{params}}, - \code{\link{progressInterval}}, \code{\link{times}} + \code{\link{paths}}, \code{\link{progressInterval}}, + \code{\link{times}} } \author{ Alex Chubaty diff --git a/man/globals.Rd b/man/globals.Rd index f197e98d9..9448376d5 100644 --- a/man/globals.Rd +++ b/man/globals.Rd @@ -43,12 +43,12 @@ but it is a \code{.globals} element in the \code{params} slot of the \code{simLi \code{\link{SpaDES.core-package}}, specifically the section 1.2.1 on Simulation Parameters. Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, \code{\link{events}}, \code{\link{inputs}}, \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, \code{\link{modules}}, \code{\link{objs}}, \code{\link{packages}}, \code{\link{params}}, - \code{\link{progressInterval}}, \code{\link{times}} + \code{\link{paths}}, \code{\link{progressInterval}}, + \code{\link{times}} } \concept{functions to access elements of a \code{simList} object} diff --git a/man/ls-method.Rd b/man/ls-method.Rd index 97400efc3..c12c2a595 100644 --- a/man/ls-method.Rd +++ b/man/ls-method.Rd @@ -28,12 +28,12 @@ stored in the \code{simList} object. } \seealso{ Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, \code{\link{events}}, \code{\link{globals}}, \code{\link{inputs}}, \code{\link{ls.str.simList}}, \code{\link{modules}}, \code{\link{objs}}, \code{\link{packages}}, \code{\link{params}}, - \code{\link{progressInterval}}, \code{\link{times}} + \code{\link{paths}}, \code{\link{progressInterval}}, + \code{\link{times}} } \concept{functions to access elements of a \code{simList} object} diff --git a/man/ls_str-method.Rd b/man/ls_str-method.Rd index 0f01588ca..f35d52734 100644 --- a/man/ls_str-method.Rd +++ b/man/ls_str-method.Rd @@ -26,12 +26,12 @@ stored in the \code{simList} object. } \seealso{ Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, \code{\link{events}}, \code{\link{globals}}, \code{\link{inputs}}, \code{\link{ls.simList}}, \code{\link{modules}}, \code{\link{objs}}, \code{\link{packages}}, \code{\link{params}}, - \code{\link{progressInterval}}, \code{\link{times}} + \code{\link{paths}}, \code{\link{progressInterval}}, + \code{\link{times}} } \concept{functions to access elements of a \code{simList} object} diff --git a/man/objects.Rd b/man/objects.Rd index c88ede3b7..b2f395346 100644 --- a/man/objects.Rd +++ b/man/objects.Rd @@ -67,12 +67,12 @@ the simulation environment. \code{\link{SpaDES.core-package}}, specifically the section 1.2.1 on Simulation Parameters. Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, \code{\link{events}}, \code{\link{globals}}, \code{\link{inputs}}, \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, \code{\link{modules}}, \code{\link{packages}}, \code{\link{params}}, - \code{\link{progressInterval}}, \code{\link{times}} + \code{\link{paths}}, \code{\link{progressInterval}}, + \code{\link{times}} } \concept{functions to access elements of a \code{simList} object} diff --git a/man/packages.Rd b/man/packages.Rd index e9f886b09..999748301 100644 --- a/man/packages.Rd +++ b/man/packages.Rd @@ -41,13 +41,13 @@ Get module or simulation package dependencies } \seealso{ Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, \code{\link{events}}, \code{\link{globals}}, \code{\link{inputs}}, \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, \code{\link{modules}}, \code{\link{objs}}, \code{\link{params}}, - \code{\link{progressInterval}}, \code{\link{times}} + \code{\link{paths}}, \code{\link{progressInterval}}, + \code{\link{times}} } \author{ Alex Chubaty & Eliot McIntire diff --git a/man/params.Rd b/man/params.Rd index becaf0f3f..76fbb5435 100644 --- a/man/params.Rd +++ b/man/params.Rd @@ -69,12 +69,12 @@ parameters(mySim) \code{\link{SpaDES.core-package}}, specifically the section 1.2.1 on Simulation parameters. Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, \code{\link{events}}, \code{\link{globals}}, \code{\link{inputs}}, \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, \code{\link{modules}}, \code{\link{objs}}, \code{\link{packages}}, - \code{\link{progressInterval}}, \code{\link{times}} + \code{\link{paths}}, \code{\link{progressInterval}}, + \code{\link{times}} } \concept{functions to access elements of a \code{simList} object} diff --git a/man/progress.Rd b/man/progress.Rd index 511846f71..89ff74acd 100644 --- a/man/progress.Rd +++ b/man/progress.Rd @@ -74,12 +74,12 @@ checkpointInterval(mySim) # 10 } \seealso{ Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, \code{\link{events}}, \code{\link{globals}}, \code{\link{inputs}}, \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, \code{\link{modules}}, \code{\link{objs}}, \code{\link{packages}}, - \code{\link{params}}, \code{\link{times}} + \code{\link{params}}, \code{\link{paths}}, + \code{\link{times}} } \concept{functions to access elements of a \code{simList} object} diff --git a/man/simList-accessors-envir.Rd b/man/simList-accessors-envir.Rd index 47d3ccfc3..ccca36d47 100644 --- a/man/simList-accessors-envir.Rd +++ b/man/simList-accessors-envir.Rd @@ -37,13 +37,13 @@ Currently, only get and set methods are defined. Subset methods are not. \code{\link{SpaDES.core-package}}, specifically the section 1.2.8 on simList environment. Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{events}}, \code{\link{globals}}, \code{\link{inputs}}, \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, \code{\link{modules}}, \code{\link{objs}}, \code{\link{packages}}, \code{\link{params}}, - \code{\link{progressInterval}}, \code{\link{times}} + \code{\link{paths}}, \code{\link{progressInterval}}, + \code{\link{times}} } \author{ Alex Chubaty diff --git a/man/simList-accessors-events.Rd b/man/simList-accessors-events.Rd index 5e17a05a1..d8ce761a4 100644 --- a/man/simList-accessors-events.Rd +++ b/man/simList-accessors-events.Rd @@ -88,12 +88,12 @@ Each event is represented by a \code{\link{data.table}} row consisting of: \code{\link{SpaDES.core-package}}, specifically the section 1.2.6 on Simulation event queues. Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, \code{\link{globals}}, \code{\link{inputs}}, \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, \code{\link{modules}}, \code{\link{objs}}, \code{\link{packages}}, \code{\link{params}}, - \code{\link{progressInterval}}, \code{\link{times}} + \code{\link{paths}}, \code{\link{progressInterval}}, + \code{\link{times}} } \concept{functions to access elements of a \code{simList} object} diff --git a/man/simList-accessors-inout.Rd b/man/simList-accessors-inout.Rd index 4b5b5a6e7..2c01cef27 100644 --- a/man/simList-accessors-inout.Rd +++ b/man/simList-accessors-inout.Rd @@ -342,12 +342,12 @@ unlink(tmpdir, recursive = TRUE) \code{\link{SpaDES.core-package}}, specifically the section 1.2.2 on loading and saving. Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, \code{\link{events}}, \code{\link{globals}}, \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, \code{\link{modules}}, \code{\link{objs}}, \code{\link{packages}}, \code{\link{params}}, - \code{\link{progressInterval}}, \code{\link{times}} + \code{\link{paths}}, \code{\link{progressInterval}}, + \code{\link{times}} } \concept{functions to access elements of a \code{simList} object} diff --git a/man/simList-accessors-metadata.Rd b/man/simList-accessors-metadata.Rd index 3f903e454..339efcbf5 100644 --- a/man/simList-accessors-metadata.Rd +++ b/man/simList-accessors-metadata.Rd @@ -1,10 +1,7 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/simList-accessors.R \docType{methods} -\name{citation} -\alias{citation} -\alias{citation,.simList-method} -\alias{citation,character-method} +\name{inputObjects} \alias{inputObjects} \alias{inputObjects,.simList-method} \alias{outputObjects} @@ -13,16 +10,11 @@ \alias{reqdPkgs,.simList-method} \alias{documentation} \alias{documentation,.simList-method} +\alias{citation} +\alias{citation,.simList-method} +\alias{citation,character-method} \title{Metadata accessors} \usage{ -citation(package, lib.loc = NULL, auto = NULL, module = character()) - -\S4method{citation}{.simList}(package, lib.loc = NULL, auto = NULL, - module = character()) - -\S4method{citation}{character}(package, lib.loc = NULL, auto = NULL, - module = character()) - inputObjects(sim, module) \S4method{inputObjects}{.simList}(sim, module) @@ -38,8 +30,21 @@ reqdPkgs(sim, module) documentation(sim, module) \S4method{documentation}{.simList}(sim, module) + +citation(package, lib.loc = NULL, auto = NULL, module = character()) + +\S4method{citation}{.simList}(package, lib.loc = NULL, auto = NULL, + module = character()) + +\S4method{citation}{character}(package, lib.loc = NULL, auto = NULL, + module = character()) } \arguments{ +\item{sim}{A \code{simList} object from which to extract element(s) or +in which to replace element(s).} + +\item{module}{Optional character string indicating which module params should come from.} + \item{package}{For compatibility with \code{\link[utils]{citation}}. This can be a \code{simList} or a character string for a package name.} @@ -55,11 +60,6 @@ a \code{simList} or a character string for a package name.} \file{CITATION} file is used if it exists, or an object of class \code{"\link{packageDescription}"} with package metadata (see below).} - -\item{module}{Optional character string indicating which module params should come from.} - -\item{sim}{A \code{simList} object from which to extract element(s) or -in which to replace element(s).} } \description{ These accessors extract the metadata for a module (if specified) or all modules diff --git a/man/simList-accessors-modules.Rd b/man/simList-accessors-modules.Rd index 2b9cb76e4..9abfca3b2 100644 --- a/man/simList-accessors-modules.Rd +++ b/man/simList-accessors-modules.Rd @@ -57,13 +57,13 @@ Currently, only get and set methods are defined. Subset methods are not. \code{\link{SpaDES.core-package}}, specifically the section 1.2.7 on Modules and dependencies. Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, \code{\link{events}}, \code{\link{globals}}, \code{\link{inputs}}, \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, \code{\link{objs}}, \code{\link{packages}}, \code{\link{params}}, - \code{\link{progressInterval}}, \code{\link{times}} + \code{\link{paths}}, \code{\link{progressInterval}}, + \code{\link{times}} } \author{ Alex Chubaty diff --git a/man/simList-accessors-paths.Rd b/man/simList-accessors-paths.Rd index ed2deca41..0e5d32faf 100644 --- a/man/simList-accessors-paths.Rd +++ b/man/simList-accessors-paths.Rd @@ -1,9 +1,7 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/simList-accessors.R \docType{methods} -\name{citation,.simList-method} -\alias{citation,.simList-method} -\alias{citation,character-method} +\name{paths} \alias{paths} \alias{simList-accessors-paths} \alias{paths,.simList-method} @@ -27,18 +25,8 @@ \alias{modulePath<-,.simList-method} \alias{dataPath} \alias{dataPath,.simList-method} -\alias{inputObjects,.simList-method} -\alias{outputObjects,.simList-method} -\alias{reqdPkgs,.simList-method} -\alias{documentation,.simList-method} \title{Specify paths for modules, inputs, and outputs} \usage{ -\S4method{citation}{.simList}(package, lib.loc = NULL, auto = NULL, - module = character()) - -\S4method{citation}{character}(package, lib.loc = NULL, auto = NULL, - module = character()) - paths(sim) \S4method{paths}{.simList}(sim) @@ -82,18 +70,8 @@ modulePath(sim) <- value dataPath(sim) \S4method{dataPath}{.simList}(sim) - -\S4method{inputObjects}{.simList}(sim, module) - -\S4method{outputObjects}{.simList}(sim, module) - -\S4method{reqdPkgs}{.simList}(sim, module) - -\S4method{documentation}{.simList}(sim, module) } \arguments{ -\item{module}{Optional character string indicating which module params should come from.} - \item{sim}{A \code{simList} object from which to extract element(s) or in which to replace element(s).} diff --git a/man/simList-accessors-times.Rd b/man/simList-accessors-times.Rd index 17ce934f6..01ea24247 100644 --- a/man/simList-accessors-times.Rd +++ b/man/simList-accessors-times.Rd @@ -146,13 +146,13 @@ of the simulation: \code{\link{SpaDES.core-package}}, specifically the section 1.2.5 on Simulation times. Other functions to access elements of a \code{simList} object: \code{\link{.addDepends}}, - \code{\link{citation,.simList-method}}, \code{\link{doEvent.checkpoint}}, \code{\link{envir}}, \code{\link{events}}, \code{\link{globals}}, \code{\link{inputs}}, \code{\link{ls.simList}}, \code{\link{ls.str.simList}}, \code{\link{modules}}, \code{\link{objs}}, \code{\link{packages}}, - \code{\link{params}}, \code{\link{progressInterval}} + \code{\link{params}}, \code{\link{paths}}, + \code{\link{progressInterval}} } \author{ Alex Chubaty and Eliot McIntire