mr_names_search: Search for region names

View source: R/region_names_search.R

mr_names_searchR Documentation

Search for region names

Description

Search for region names

Usage

mr_names_search(x, q = NULL, ...)

Arguments

x, q

Either a tbl_df, returned from mr_names(), or a query as a character string. If a tbl_df, you must pass a query string to q. If a query string (character) is passed to x, leave q as NULL

...

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

## Not run: 
# 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")

## End(Not run)

mregions documentation built on April 12, 2022, 1:05 a.m.