Learn R Programming

red (version 0.2.0)

thin: Spatial thinning of occurrence records.

Description

Thinning of records with minimum distances either absolute or relative to the species range.

Usage

thin(longlat, distance = 0.01, relative = TRUE, runs = 100)

Arguments

longlat
Matrix of longitude and latitude (two columns) of species occurrence records.
distance
Distance either in relative terms (proportion of maximum distance between any two records) or in raster units.
relative
If TRUE, represents the proportion of maximum distance between any two records. If FALSE, is in raster units.
runs
Number of runs

Value

A matrix of longitude and latitude (two columns) of species occurrence records separated by at least the given distance.

Details

Clumped distribution records due to ease of accessibility of sites, emphasis of sampling on certain areas in the past, etc. may bias species distribution models. The algorithm used here eliminates records closer than a given thres to any other record. The choice of records to eliminate is random, so a number of runs are made and the one keeping more of the original records is chosen.

Examples

Run this code
records <- matrix(sample(100), ncol = 2)
par(mfrow=c(1,2))
graphics::plot(records)
records <- thin(records, 0.1)
graphics::plot(records)

Run the code above in your browser using DataLab