Coder Social home page Coder Social logo

natserv's Introduction

natserv

Build Status codecov cran version rstudio mirror downloads

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

Installation

Stable version from CRAN

install.packages("natserv")

Development version

install.packages("devtools")
devtools::install_github("ropensci/natserv")
library('natserv')

search

ns_search(x = "Helianthus annuus")
#> # A tibble: 1 × 4
#>          globalSpeciesUid jurisdictionScientificName       commonName
#>                     <chr>                      <chr>            <chr>
#> 1 ELEMENT_GLOBAL.2.134717          Helianthus annuus Common Sunflower
#> # ... with 1 more variables: natureServeExplorerURI <chr>

data

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

dig into distribution in various watersheds

res$ELEMENT_GLOBAL.2.100925$distribution$watersheds
#> # A tibble: 458 × 4
#>     type         watershedName watershedCode speciesOccurrenceCount
#>    <chr>                 <chr>         <chr>                  <chr>
#> 1  HUC-8              Allagash      01010002                      1
#> 2  HUC-8 East Branch Penobscot      01020002                      1
#> 3  HUC-8        Upper Kennebec      01030001                      1
#> 4  HUC-8                  Dead      01030002                      7
#> 5  HUC-8        Lower Kennebec      01030003                      1
#> 6  HUC-8    Upper Androscoggin      01040001                      2
#> 7  HUC-8    Lower Androscoggin      01040002                      2
#> 8  HUC-8                  Saco      01060002                      4
#> 9  HUC-8          Upper Hudson      02020001                      3
#> 10 HUC-8      Hudson-Wappinger      02020008                      2
#> # ... with 448 more rows

image metadata

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

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for natserv in R doing citation(package = 'natserv')
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

ropensci

natserv's People

Contributors

christophertracey avatar mairindeith avatar sckott avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.