View source: R/machuruku_code.R
machu.occ.rarefy | R Documentation |
Rarefy spatial occurrence points to reduce spatial autocorrelation and model bias. This is a modified version of humboldt.occ.rarefy() from humboldt.
machu.occ.rarefy(
in.pts,
colxy = 2:3,
rarefy.dist = 0,
rarefy.units = "km",
plot = F,
verbose = T
)
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. |
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.
A dataframe with rarefied occurrence data.
##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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.