env_thin_b: Thinning of occurrence records using environmental...

View source: R/1.1b.f.occ.thin.R

env_thin_bR Documentation

Thinning of occurrence records using environmental information

Description

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.

Usage

env_thin_b(
  p.lst,
  predictors.lst,
  long.col = NULL,
  lat.col = NULL,
  bins = 20,
  plot = F,
  verbose = F
)

Arguments

p.lst

List of two column matrix or data.frame with point coordinates or SpatialPoints of occurrence records.

predictors.lst

A Raster-class or list of Raster-class object containing the predictor variables.

lat.col, long.col

Name of columns that contain coordinates (latitude and longitude)

bins

Number of bins to divide each environmental variable.

plot

Logical. Should results be plotted?

verbose

Logical. Should information be printed on screen?

Value

A data.frame, matrix, sp or sf object containing the selected records.

See Also

env_thin, load_env_thin_occ

Examples

## 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")
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_b(list(coord), list(predictors))

## End(Not run)


HemingNM/ENMwizard documentation built on Jan. 4, 2024, 3:24 p.m.