View source: R/records_by_type.R
mr_records_by_type | R Documentation |
Get Marineregions records by place type
mr_records_by_type(type, offset = 0, ...)
type |
(character) One place type name. See
|
offset |
(numeric) Offset to start at. Each request can return up to 100 results. e.g., an offset of 200 will give records 200 to 299. |
... |
Curl options passed on to |
Internally we use the getGazetteerRecordsByType.json
API
method, which searches for Marineregions records by user supplied place type
If no results, an empty list. If results found, a data.frame with the columns:
MRGID (integer)
gazetteerSource (character)
placeType (character)
latitude (numeric)
longitude (numeric)
minLatitude (numeric)
minLongitude (numeric)
maxLatitude (numeric)
maxLongitude (numeric)
precision (numeric)
preferredGazetteerName (character)
preferredGazetteerNameLang (character)
status (character)
accepted (integer)
## Not run:
# Get records of type 'EEZ', then inspect data.frame
res <- mr_records_by_type(type="EEZ")
head(res)
# You can use mr_place_types() function to get types
## then pass those into this function
types <- mr_place_types()
mr_records_by_type(types$type[1])
mr_records_by_type(types$type[10])
# use regex to find a type name matching a pattern
x <- grep("MEOW", types$type, value = TRUE)
# then pass to the function
mr_records_by_type(x)
mr_records_by_type(x, offset = 100)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.