diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e77849e --- /dev/null +++ b/NEWS @@ -0,0 +1,4 @@ +FLasher 0.1 +=========== + +* `fwdElement` class as a basic component of `fwdControl` diff --git a/R/classes.R b/R/classes.R index 5aedcf6..e0c004f 100644 --- a/R/classes.R +++ b/R/classes.R @@ -42,6 +42,58 @@ setClass('fwdElement', # fwdControl class {{{ +#' A class for the targets and limits of a fishery projection. +#' +#' The desired targets, limits and time steps used in fishery projections can be +#' specified by creating an object of class \code{fwdControl}. +#' +#' [...] +#' +#' @name fwdControl +#' @rdname fwdControl +#' @aliases fwdControl fwdControl-methods fwdControl-class +#' @docType class +#' +#' @section Slots: +#' \describe{ +#' \item{target}{The table of values, quantities and time steps used as target (\code{fwdElement}).} +#' } +#' +#' @section Validity: \describe{ +#' \item{VALIDITY}{Neque porro quisquam est qui dolorem ipsum.} +#' } +#' +#' @section Accessors: +#' All slots in the class have accessor and replacement methods defined that +#' allow retrieving and substituting individual slots. +#' +#' The values passed for replacement need to be of the class of that slot. +#' A numeric vector can also be used when replacing FLQuant slots, and the +#' vector will be used to substitute the values in the slot, but not its other +#' attributes. +#' +#' @section Constructor: +#' +#' A construction method exists for this class that can take named arguments for +#' any of its slots. All slots are then created to match the requirements of the +#' class validity. If an unnamed \code{FLQuant} object is provided, this is used +#' for sizing but not stored in any slot. +#' +#' @author Iago Mosqueira, Finlay Scott - EC JRC. +#' @seealso \link{fwdElement} +#' @keywords classes +#' @examples +#' +#' # CREATE targets on fishing mortality ('f') by year +#' +#' target <- data.frame(year=2000:2010, value=rlnorm(11), quantity='f') +#' +#' fwc <- fwdControl(target=target) +#' +#' # INSPECT fwdControl object +#' +#' show(fwc) + setClass('fwdControl', representation( target='fwdElement'), prototype(target=new('fwdElement'))) diff --git a/README.md b/README.md index a1e78c5..4df1ede 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,13 @@ # FLasher -New version of Flash +FLasher provides the necessary classes and methods for carrying out +stochastic and deterministic projections of fisheries, both fish stocks +and fish population plus fleets. -## TODO +- PROJECTION -- [ ] ADD roxygen documentation +- CLASSES + +- METHODS + +- MORE INFO