search_ipni: Search IPNI.

View source: R/ipni.R

search_ipniR Documentation

Search IPNI.

Description

Query the International Plant Names Index for nomenclatural information.

Usage

search_ipni(query, filters = NULL, cursor = "*", limit = 50, .wait = 0.1)

Arguments

query

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

filters

Filter to apply to search results.

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. This has a maximum of 1000.

.wait

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

Details

The International Plant Names Index (IPNI) is a service that provides nomenclatural information for vascular plant names.

The search API allows users to query the database for plant names, as well as authors and publications. There may be limited support for some sort of fuzzy matching.

There is some support for querying using keyword arguments. Documentation for the API is currently available in the pykew package, so keywords have been copied across from there. There are sets of keywords relating to plants, authors, and publications. A full list of keywords can be viewed using the get_keywords function.

The API will return nomenclatural information (publication date, nomenclatural status, author, etc.) of all names matching the query. These results can be limited, for example to only family names, using filters. Use the get_filters function to get a list of all implemented filters.

Value

Returns an object of class ipni_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_ipni() to look up a name using an IPNI ID.

Other IPNI functions: lookup_ipni()

Examples

# search for all names containing Poa annua
results <- search_ipni("Poa annua")

# tidy search results in a table
tidy(results)

# extract author team information for the search results
results_tbl <- tidy(results)
tidyr::unnest(results_tbl, cols=c(authorTeam), names_sep="_")

# filter results to only species names
species_results <- search_ipni("Poa annua", filters="species")
tidy(species_results)

# search for species from Mexico published in 1989
q <- list(published="1989", distribution="Mexico")
f <- "species"
results <- search_ipni(q, filters=f)
tidy(results)

# search for an author by surname
author_results <- search_ipni(list(author_surname="Gardiner"))
tidy(author_results)


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