R/getListStocks.R

Defines functions getListStocks

Documented in getListStocks

#' Get a List of Fish Stocks
#'
#' Get a list of fish stocks for a given assessment year.
#'
#' @param year the assessment year, e.g. 2015, or 0 to process all years.
#'
#' @return A data frame.
#'
#' @seealso
#' \code{\link{getSummaryTable}} gets a summary table of historical stock size.
#'
#' \code{\link{getFishStockReferencePoints}} gets biological reference points.
#'
#' \code{\link{icesSAG-package}} gives an overview of the package.
#'
#' @author Colin Millar, Scott Large, and Arni Magnusson.
#'
#' @examples
#' \dontrun{
#' stocks <- getListStocks(2015)
#' }
#' @export

getListStocks <- function(year) {
  # call webservice for all supplied years
  out <- lapply(year, function(i) sag_webservice("getListStocks", year = i))

  # parse output
  do.call(rbind, lapply(out, sag_parse))
}

Try the icesSAG package in your browser

Any scripts or data that you put into this service are public.

icesSAG documentation built on March 18, 2022, 6:54 p.m.