getSAG: Get Any SAG Data

View source: R/getSAG.R

getSAGR Documentation

Get Any SAG Data

Description

This function combines the functionality of getListStocks, getFishStockReferencePoints, getSummaryTable and getStockDownloadData. It supports querying many stocks and years in one function call.

Usage

getSAG(stock, year, data = "summary", combine = TRUE, purpose = "Advice")

Arguments

stock

a stock name, e.g. cod-347d, or cod to find all cod stocks, or NULL to process all stocks.

year

the assessment year, e.g. 2015, or 0 to process all years.

data

the data of interest, either "summary", "refpts" or "source".

combine

whether to combine the list output to a data frame.

purpose

the purpose of the entry, options are "Advice", "Bench", "InitAdvice", default is "Advice".

Value

A data frame (default) or a list if combine is TRUE.

Note

Only years with "Published" status are returned.

Author(s)

Colin Millar.

See Also

getListStocks, getSummaryTable, getFishStockReferencePoints, and getStockDownloadData get a list of stocks, summary results, reference points, and all data including custom columns.

findAssessmentKey finds lookup keys.

icesSAG-package gives an overview of the package.

Examples

## Not run: 
summary <- getSAG("had.27.46a20", 2022)
refpts <- getSAG("had.27.46a20", 2022, "refpts")

cod_summary <- getSAG("cod", 2022)
cod_refpts <- getSAG("cod", 2015:2016, "refpts")
cod_data <- getSAG("cod", 2017, "source-data")

## End(Not run)

icesSAG documentation built on Oct. 30, 2024, 9:14 a.m.