getSAG {icesSAG} | R Documentation |
Get Any SAG Data
Description
This function combines the functionality of getListStocks, getFishStockReferencePoints, and getSummaryTable. 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)
Arni Magnusson and Colin Millar.
See Also
getListStocks
, getSummaryTable
, and
getFishStockReferencePoints
get a list of stocks, summary
results, and reference points.
findAssessmentKey
finds lookup keys.
icesSAG-package
gives an overview of the package.
Examples
## Not run:
summary <- getSAG("cod-347d", 2015)
refpts <- getSAG("cod-347d", 2015, "refpts")
getSAG("her.27.3a47d", 2017, "refpts", purpose = "Benchmark")
cod_summary <- getSAG("cod", 2015)
cod_refpts <- getSAG("cod", 2015:2016, "refpts")
cod_data <- getSAG("cod", 2017, "source-data")
## End(Not run)