overlayBirds: Overlay BIRDS object and grid

Description Usage Arguments Details Value Examples

View source: R/overlayBirds.R

Description

Make an overlay for an OrganizedBirds object and a grid to identify which observations that fall into which grid cell.

Usage

1
2
3
4
overlayBirds(x, grid, spillOver = NULL, cleanGrid = TRUE)

## S3 method for class 'OrganizedBirds'
overlayBirds(x, grid, spillOver = NULL, cleanGrid = TRUE)

Arguments

x

An OrganizedBirds object

grid

A sf or SpatialPolygonsDataFrame object of the grid over the study area

spillOver

Specifies if the function should search for observations with the same visitUID over several grid cell, and what to do with them. It accepts c(NULL, "unique", "duplicate"). Default NULL.

cleanGrid

logical. Whether to remove all data from the grid.

Details

This function takes an OrganizedBirds object, created by organizeBirds, and a polygon grid-layer, which could be created by makeGrid and splits the visits in the OrganizedBirds (i.e. data belonging to identified visits) to each grid cell.

If spillOver = NULL the splitting is done spatially according to the overlay of observations and grid cells, without further consideration of coherence for visits (visit UID). If spillOver = c("unique", "duplicate") the splitting will be done spatially in a first step, and then: if (spillOver = "unique") assigns (and moves) all observations with same visitUID to the grid cell with most observations (or picks one grid cell at random if there is a tie); or if (spillOver = "duplicate") duplicates all observations with same visitUID across all grid cells containing at least one observation with that visitUID.

The later approach is useful when the amount of observations spilled over neighbouring cells is minimal and information over the spatial extent of the sampling effort is more important than sample independence.

Value

The output is a OverlaidBirds-class object, which is a list containing three objects;

observationsInGrid

Is basically the data in the OrganizedBirds object split by each grid cell (n.b. the use of spillOver discussed under "Usage")

grid

The sf from the input, optionally cleared of data

nonEmptyGridCells

An integer vector of which grid cells that have observations

Examples

1
2
3

BIRDS documentation built on June 27, 2021, 1:06 a.m.