rnpn is an R client for the US National Phenology Network API.

National Phenology Network API documentation.

Note that there is no need for an API key to grab data from the National Phenology Network, but I think there is for writing data through the API. Currently, functions in this package only allow getting data, but may at some point allow posting data to the USNPN.

Installation

Stable version

Development version

devtools::install_github("ropensci/rnpn")
library('rnpn')

Observations by day

Get observations by day for a particular species or set of species.

library('plyr')
temp <- lookup_names(name = 'bird', type = 'common')
comnames <- as.character(temp[temp$species_id %in% c(357, 359, 1108), 'common_name'])

out <- npn_obsspbyday(speciesid = c(357, 359, 1108), startdate = '2010-04-01', enddate = '2013-09-31')
names(out) <- comnames
df <- ldply(out)
df$date <- as.Date(df$date)

library('ggplot2')
ggplot(df, aes(date, count)) +
 geom_line() +
 theme_grey(base_size = 20) +
 facet_grid(.id ~ .)

plot of chunk unnamed-chunk-9

Search for species

All species

By ITIS taxonomic serial number

By USNPN id

By state (and optionally kingdom)

By scientific name

By common name

Filter by network, group, year, or station

Meta

image