natserv NatureServe R client

NatureServe is a non-profit organization that provides wildlife conservation related data to various groups including the public.

All functions in this package are prefixed with ns_ to prevent collision with other pkgs.

Three NatureServe web services are available in this package:

  • Name lookup (ns_search) lookup species Unique IDs (UID) by name. These UIDs are required for access to the more detailed services.
  • Image lookup (ns_images) search for metadata for NatureServe images, including the URL’s for the image files themselves.
  • Fetch data (ns_data) on over 70,000 of the plant and animal species of the United States and Canada.

You’ll need an API key to use this package. Get one by signing up at https://services.natureserve.org/developer/index.jsp

See also the taxize book (https://taxize.dev/) for a manual on working with taxonomic data in R, including with NatureServe data.

Installation

Stable version from CRAN

install.packages("natserv")

Development version

remotes::install_github("ropensci/natserv")
library('natserv')

data

res <- ns_data(uid = 'ELEMENT_GLOBAL.2.100925')
names(res$ELEMENT_GLOBAL.2.100925)
#>  [1] "uid"                   "speciesCode"           "natureserve_uri"      
#>  [4] "classification"        "economicAttributes"    "ecologyAndLifeHistory"
#>  [7] "license"               "references"            "conservationStatus"   
#> [10] "managementSummary"     "distribution"

dig into distribution in various watersheds

res$ELEMENT_GLOBAL.2.100925$distribution$watersheds
#> # A tibble: 599 x 4
#>    type  watershedName    watershedCode speciesOccurrenceCount
#>    <chr> <chr>            <chr>         <chr>                 
#>  1 HUC-8 Housatonic       01100005      1                     
#>  2 HUC-8 Upper Hudson     02020001      3                     
#>  3 HUC-8 Middle Hudson    02020006      1                     
#>  4 HUC-8 Hudson-Wappinger 02020008      2                     
#>  5 HUC-8 Noxubee          03160108      1                     
#>  6 HUC-8 Lower Leaf       03170005      1                     
#>  7 HUC-8 Pascagoula       03170006      2                     
#>  8 HUC-8 Black            03170007      1                     
#>  9 HUC-8 Escatawpa        03170008      1                     
#> 10 HUC-8 Black            04150101      1                     
#> # … with 589 more rows

image metadata

res <- ns_images(commonName = "*eagle", resolution = 'thumbnail')
res$images[[1]][1:5]
#> $id
#> [1] "15512"
#> 
#> $scientificName
#> [1] "Haliaeetus leucocephalus"
#> 
#> $commonName
#> [1] "Bald Eagle"
#> 
#> $otherCommonName
#> [1] "bald eagle"
#> 
#> $otherCommonName
#> [1] "pygargue à tête blanche"

Meta