View source: R/1.1b.f.occ.thin.R
env_thin | R Documentation |
The function thins spatial points to minimize biases in the environmental space. It divides de range of variables into a desired number of @param bins and selects points closer to the bin center.
env_thin(
p,
predictors,
long.col = NULL,
lat.col = NULL,
bins = 20,
file = NULL,
plot = F,
verbose = F
)
p |
Two column matrix or data.frame with point coordinates
or |
predictors |
|
lat.col, long.col |
Name of columns that contain coordinates (latitude and longitude) |
bins |
Number of bins to divide each environmental variable. |
file |
either a character string naming a file or a connection open for writing. |
plot |
Logical. Should results be plotted? |
verbose |
Logical. Should information be printed on screen? |
A data.frame, matrix, sp or sf object containing the selected records.
env_thin_b
, load_env_thin_occ
## Not run:
file <- paste(system.file(package="dismo"), "/ex/bradypus.csv", sep="")
bradypus <- read.table(file, header=TRUE, sep=',')
coord <- bradypus [,2:3]
# Download data for present
dir.create("rasters")
library(raster)
predictors <- getData('worldclim', var='bio', res=10, path="rasters")
#cor(data)
#vars <- ENMwizard::select_vars(cutoff = 0.9, corr.mat = cor(data), names.only = T)[[1]]
#length(vars)
env_thin(coord, predictors)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.