ebirdst_subset: Subset eBird Status and Trends data spatiotemporally

View source: R/ebirdst-subset.R

ebirdst_subsetR Documentation

Subset eBird Status and Trends data spatiotemporally

Description

Spatiotemporally subset the raster or tabular eBird Status and Trends data. The spatiotemporal extent should be defined using ebirdst_extent().

Usage

ebirdst_subset(x, ext)

## S3 method for class 'data.frame'
ebirdst_subset(x, ext)

## S3 method for class 'sf'
ebirdst_subset(x, ext)

## S3 method for class 'Raster'
ebirdst_subset(x, ext)

Arguments

x

eBird Status and Trends data to subset; either a RasterStack object with 52 layers (one for each week) or a data frame with PI or PD data.

ext

ebirdst_extent object; the spatiotemporal extent to filter the data to.

Value

eBird Status and Trends data in the same format as the input data, but subset in space and time.

Methods (by class)

  • ebirdst_subset(data.frame): PI or PD data

  • ebirdst_subset(sf): PI or PD data as an sf object

  • ebirdst_subset(Raster): Status and Trends rasters

Examples

## Not run: 
# download example data
path <- ebirdst_download("example_data")
# or get the path if you already have the data downloaded
path <- get_species_path("example_data")

# bbox for southern michigan in may
bb_vec <- c(xmin = -86, xmax = -83, ymin = 41.5, ymax = 43.5)
e <- ebirdst_extent(bb_vec, t = c("05-01", "05-31"))

# load and subset raster data
abd <- load_raster(path, product = "abundance", resolution = "lr")
abd_ss <- ebirdst_subset(abd, ext = e)

## End(Not run)

CornellLabofOrnithology/stemhelper documentation built on Feb. 5, 2023, 9:59 a.m.