Learn R Programming

spThin (version 0.2.0)

thin: Spatially thin species occurence data

Description

thin returns spatially thinned species occurence data sets. A randomizaiton algorithm (thin.algorithm) is used to create data set in which all occurnece locations are at least thin.par distance apart. Spatial thinning helps to reduce the effect of uneven, or biased, species occurence collections on spatial model outcomes.

Usage

thin(
  loc.data,
  lat.col = "LAT",
  long.col = "LONG",
  spec.col = "SPEC",
  thin.par,
  reps,
  locs.thinned.list.return = FALSE,
  write.files = TRUE,
  max.files = 5,
  out.dir,
  out.base = "thinned_data",
  write.log.file = TRUE,
  log.file = "spatial_thin_log.txt",
  verbose = TRUE
)

Arguments

loc.data

A data.frame of occurence locations. It can include several columnns, but must include at minimum a column of latitude values, a column of longitude values, and a column of species names.

lat.col

Name of column of latitude values. Caps sensitive.

long.col

Name of column of longitude values. Caps sensitive.

spec.col

Name of column of species name. Caps sensitive.

thin.par

Thinning parameter - the distance (in kilometers) that you want records to be separated by.

reps

The number of times to repete the thinning process. Given the random process of removing nearest-neighbors there should be 'rep' number of different sets of coordinates.

locs.thinned.list.return

TRUE/FALSE - If true, the `list` of the data.frame of thinned locs resulting from each replication is returned (see Returns below).

write.files

TRUE/FALSE - If true, new *.csv files will be written with the thinned locs data

max.files

The maximum number of *csv files to be written based on the thinned data

out.dir

Directory to write new *csv files to

out.base

A file basename to give to the thinned datasets created

write.log.file

TRUE/FALSE create/append log file of thinning run

log.file

Text log file

verbose

TRUE/FALSE - If true, running details of the function are print at the console.

Value

locs.thinned.dfs A list of data.frames, each data.frame the spatially thinned locations of the algorithm for a single replication. This list will have `reps` elements.

See Also

thin.algorithm