machu.occ.rarefy: Rarefy occurrence points

View source: R/machuruku_code.R

machu.occ.rarefyR Documentation

Rarefy occurrence points

Description

Rarefy spatial occurrence points to reduce spatial autocorrelation and model bias. This is a modified version of humboldt.occ.rarefy() from humboldt.

Usage

machu.occ.rarefy(
  in.pts,
  colxy = 2:3,
  rarefy.dist = 0,
  rarefy.units = "km",
  plot = F,
  verbose = T
)

Arguments

in.pts

Input dataframe.

colxy

Columns corresponding to longitude, then latitude. Default = 2:3.

rarefy.dist

Distance to rarefy points (values need to be in km (recommended) or decimal degrees). See associated parameter rarefy.units. Default = 0.

rarefy.units

The units of the rarefy.dist parameter, either "km" for kilometers or "dd" for decimal degrees. Default = "km".

plot

Creates an optional plot visualizing the points removed and kept. Default = F.

verbose

If verbose=T, text boxes displaying progress will be displayed. Default = T.

Details

A script to systematically select localities within a specified area at specified spatial resolution. The outcome is always the same and is not random. This reduces sampling biases in downstream analyses- you should do it! Output is a reduced dataset with less spatial autocorrelation.

Value

A dataframe with rarefied occurrence data.

Examples

##remove occurrences closer than a minimum distance to each other (remove aggregation). Setting min.dist=0 will remove no occurrence.
occ <- machu.occ.rarefy(in.pts = occ, colxy = 2:3, rarefy.dist = 50, rarefy.units = "km")

wxguillo/machuruku documentation built on Jan. 23, 2025, 3:25 p.m.