Returns SuperPopulations table
The SuperPopulations table_id is set automatically using a saved data frame from a rcax_datasets()
call. The table is saved in R/sysdata.rda
.
rcax_superpops()
will download 1000 records. Pass in flist
to filter.
The name of the table in the CAX API. See vignette("CAX_Tables", package = "rCAX")
A filter for the query. See details and rcax_filter()
Additional query parameters. See rcax_table_query()
for details.
column names to return. Use cols=NULL if you want all columns. Names are case insensitive.
The columns to sort on for the returned table. The order of sortcols indicates the order of sorting. Start with the smallest group and work outwards, e.g. c("spawningyear", "popid", "MPG")
. Names are case insensitive.
whether to return the table ("data.frame") or colnames with definitions ("colnames"). Default is to return the table as a data frame.
A list of arguments for the rcax_GET()
call. These do not need to be specified by the user unless the user wants to change the default values. table_id
This is the CAX table id. It is looked up using tablename
and rCAX:::caxpops
(an internal dataset). If table_id
is passed in via GETargs
, it will override the default table id lookup. recordloc
This is the name of the record we want in the list returned from the GET call. key
is the API key.
Curl options passed to HttpClient
data frame if type="data.frame"
(default) and the colnames if type="colnames"
# print the first columns and definitions
a <- rcax_superpops(type="colnames")
paste(a$name, a$definition, sep=": ")[1:5]
#> [1] "contactagency: Organization or person that is the best contact for questions about a specific record."
#> [2] "id: Value used by computer to identify a record."
#> [3] "num: An internal sorting id"
#> [4] "popfit: Categorization of how the geographic extent of the NOSA/escapement estimate corresponds to the definition of the population."
#> [5] "popfitnotes: Text description of why the data are not at the scale of a single population."
# get one record
rcax_superpops(qlist=list(limit=1))
#> popid popfit popfitnotes upddate
#> 1 302 Same January, 13 2020 13:59:54
#> contactagency num
#> 1 Pacific States Marine Fisheries Commission 1
#> id publish superpopid
#> 1 0007CC8D-3ADF-4052-A178-26E29C126214 Yes 1056