spThinner: Spatially thin a data frame of eBird records

Description Usage Arguments Details Value References Examples

Description

Single data frame spatial thinning within an R session.

Usage

1
2
spThinner(ebird.data, xxx, yyy, latitude, longitude, xlim = c(NA, NA),
  ylim = c(NA, NA), nx, ny, jitter = FALSE, size, replace = FALSE)

Arguments

ebird.data

Dataframe of eBird records.

xxx

Either E-W coordinates, or the word "extent". If extent is desired, make sure to specify for both xxx & yyy. Function will not handle mixture gracefully.

yyy

Either N-S coordinates, or the word "extent". If extent is desired, make sure to specify for both xxx & yyy. Function will not handle mixture gracefully.

latitude

The name of the latitude column in the files.

longitude

The name of the longitude column in the files.

xlim

Together xlim and ylim define a bounding box within which lookup occurs. I.e. all (xxx, yyy) pairs outside of this box are ignored.

ylim

Together xlim and ylim define a bounding box within which lookup occurs. I.e. all (xxx, yyy) pairs outside of this box are ignored.

nx

Number of grid cells in x direction.

ny

Number of grid cells in y direction.

jitter

Defaults to FALSE. Set to TRUE to randomize grid location.

size

Maximum number of points per cell to sample

replace

Defaults to FALSE. Set to TRUE to sample with replacement.

Details

This applies sample.grid.cell() to single eBird data frame.

Value

A spatially thinned data frame.

References

Team eBird.

Examples

1
2
3
4
5
6
7
data(ex)
plot(ex$LONGITUDE~ex$LATITUDE, col="blue", pch=20, cex=2)
thinned <- spThinner(ebird.data=ex, xxx="extent", yyy="extent",
  latitude="LATITUDE", longitude="LONGITUDE", nx=2, ny=2, size=3)
points(y=thinned$LONGITUDE, x=thinned$LATITUDE, col="red", pch=20, cex=1)
#the blue points are the original data, the red points are the accepted points
#after spatial thinning.

eliotmiller/ebirdr documentation built on May 14, 2019, 10:33 a.m.