search_powo: Search POWO.

View source: R/powo.R

search_powoR Documentation

Search POWO.

Description

Query Plants of the World Online for taxon information.

Usage

search_powo(query, filters = NULL, cursor = NULL, limit = 50, .wait = 0.2)

Arguments

query

The string to query POWO with. If using keywords, the query must be formatted as a list.

filters

Filter to apply to search results. Multiple filters must be supplied as a character vector.

cursor

A cursor returned by a previous search. If used, the query and filter must be exactly the same.

limit

The maximum number of records to return.

.wait

Time to wait before making a request, to help rate limiting.

Details

Plants of the World Online (POWO) is a database of information on the world's flora. It curates information from published floras and other sources of floristic information.

The search API allows users to query the database using plant names, geographic terms, and floristic characters. These can be queried using keyword arguments. Use the get_keywords function for a list of all implemented keywords.

The API returns taxonomic information as well as species descriptions and image locations if available. These results can be limited, for example to accepted species, using filters. Use the get_filters function to get a list of all implemented filters.

Distributions in POWO are categorised using the World Geographical Scheme for Recording Plant Distributions (WGSRP). Users can query POWO using distributions listed under WGSRPD levels 1 (continents), 2 (regions), and 3 (botanical countries).

Value

Returns an object of class powo_search that is a simple structure with slots for:

  • total: the total number of results held in POWO for the query

  • pages: the total number of results pages for the query.

  • limit: the maximum number of results requested from the API, per page.

  • cursor: a cursor to retrieve the next page of results from the API.

  • results: the query results parsed into a list.

  • query: the query string submitted to the API.

  • response: the httr response object.

See Also

  • lookup_powo() to look up a taxon in POWO using the IPNI ID.

Other POWO functions: lookup_powo()

Examples

# search for all entries containing a genus name
search_powo("Myrcia")

# search for all accepted species within a genus
search_powo("Myrcia", filters=c("species", "accepted"))

# search for up to 100 species in a genus
search_powo("Poa", filters=c("species"), limit=100)

# search for all names in a family
search_powo(list(family="Myrtaceae"))

# search for all accepted species with blue flowers
search_powo(list(flower="blue"), filters=c("accepted", "species"))

# search for all accepted genera in Mexico
search_powo(list(distribution="Mexico"), filters=c("accepted", "genera"))

# search for a species name and print the results
r <- search_powo("Myrcia guianensis", filters=c("species"))
print(r)

# simplify search results to a `tibble`
r <- search_powo("Poa", filters=c("species"))
tidy(r)


barnabywalker/kewr documentation built on July 5, 2022, 5:37 p.m.