R/getSurveyYearList.R

Defines functions getSurveyYearList

Documented in getSurveyYearList

#' Get a List of Survey Years
#'
#' Get a list of all data years for a given survey.
#'
#' @param survey the survey acronym, e.g. NS-IBTS.
#'
#' @return A numeric vector.
#'
#' @seealso
#' \code{\link{getSurveyList}}, \code{\link{getSurveyYearQuarterList}}, and
#' \code{\link{getDatrasDataOverview}} also list available data.
#'
#' \code{\link{icesDatras-package}} gives an overview of the package.
#'
#' @author Colin Millar.
#'
#' @examples
#' \dontrun{
#' getSurveyYearList(survey = "ROCKALL")
#' }
#' @export

getSurveyYearList <- function(survey) {
  # check web services are running
  if (!checkDatrasWebserviceOK()) return (FALSE)

  # read url and parse to data frame
  url <-
    sprintf(
      "https://datras.ices.dk/WebServices/DATRASWebService.asmx/getSurveyYearList?survey=%s",
      survey)
  out <- readDatras(url)
  out <- parseDatras(out)

  out$Year
}

Try the icesDatras package in your browser

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

icesDatras documentation built on May 31, 2023, 7:34 p.m.