Search for region names
Arguments
- x, q
Either a
tbl_df
, returned frommr_names()
, or a query as a character string. If atbl_df
, you must pass a query string toq
. If a query string (character) is passed tox
, leaveq
asNULL
- ...
Parameters passed on to
agrep()
Value
NULL
if no matches found, or a data.frame, or tibble, of class
tbl_df
, with slots:
name (character) - name of the region, which is a combination of the name_first and name_second, e.g., Morocco:elevation_10m
title (character) - title for the region
name_first (character) - first part of the name, e.g., Morocco
name_second (character) - second part of the name, e.g., elevation_10m
Examples
if (FALSE) {
# Get region names with mr_names() function
(res <- mr_names("MarineRegions:eez"))
# to save time, pass in the result from mr_names()
mr_names_search(res, q = "Amer")
# if you don't pass in the result from mr_names(), we have to
# call mr_names() internally, adding some time
mr_names_search(x = "iho", q = "Black")
mr_names_search(x = "iho", q = "Sea")
# more examples
mr_names_search("iho", "Sea")
(res <- mr_names("MarineRegions:iho"))
mr_names_search(res, q = "Sea")
}