get_hierarchy_string: get_hierarchy_string

Description Usage Arguments Value Examples

View source: R/get_hierarchy_string.R

Description

This a helper function to generate a formatted hierarchy string for a given taxon to use in the Bad Neighbor BAP. The function uses the SOLR service from the Integrated Taxonomic Information System ([ITIS](https://www.itis.gov)).

Usage

1

Arguments

taxon_name

A string for a scientific name for a taxonomic group to search

Value

A tibble with the returned tsn, taxonomic rank and formatted hierarchy string to use in other parts of the BAP

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# query ITIS to get the string
h_string <- get_hierarchy_string("Poaceae")

# print the result
h_string
# A tibble: 1 x 4
# tsn   rank   taxon   hierarchy_homonym_string
# <chr> <chr>  <chr>   <chr>                   
#    1 40351 Family Poaceae "*\\-40351\\-*"
    
# use the result in the main bad neighbor query using state name and optional flag
buff_nn <- state_bad_neighbor_query(state_name = "Virginia", taxon = h_string$hierarchy_homonym_string, get_buffer_fips = TRUE)

usgs-bis/bad-neighbor-invasives documentation built on Sept. 26, 2019, 7:34 a.m.