occ_blocksplit: Split occurrences in training and testing data using blocks

View source: R/helpers.R

occ_blocksplitR Documentation

Split occurrences in training and testing data using blocks

Description

occ_blocksplit splits a set of occurrences to obtain training and testing data using blocks.

Usage

occ_blocksplit(
  data,
  longitude,
  latitude,
  train_proportion = 0.75,
  raster_layer = NULL,
  background_n = 10000
)

Arguments

data

matrix or data.frame with the occurrences to be split. Columns may vary but species, longitude, and latitue are recommended.

longitude

(character) name of the column with longitude data.

latitude

(character) name of the column with latitude data.

train_proportion

(numeric) proportion of data to be used as training occurrences. Available options are 0.25, 0.5, and 0.75. The remaining data will be used for testing. Default = 0.75.

raster_layer

optional RasterLayer to prepare background data.

background_n

(numeric) optional number of coordinates to be extracted using the raster_layer. Default = 10000.

Value

List with all occurrences (all), training occurrences (train), testing (test) occurrences, and all occurrences with assigned blocks (block).

If a raster layer is given in raster_layer, background coordinates will be returned as part of this list. Data will be named as bg_all, bg_train, bg_test, and bg_block, for all, training, testing, and all background with assigned blocks, respectively.


marlonecobos/ellipsenm documentation built on Oct. 18, 2023, 8:09 a.m.