occ_randsplit: Split occurrences randomly in training and testing data

View source: R/kuenm_occsplit.R

occ_randsplitR Documentation

Split occurrences randomly in training and testing data

Description

occ_randsplit splits a set of occurrences to obtain training and testing data randomly.

Usage

occ_randsplit(occ, train.proportion = 0.5)

Arguments

occ

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

train.proportion

(numeric) proportion (from 0 to 1) of data to be used as training occurrences. The remaining data will be used for testing.

Value

List with all occurrences (joint), training occurrences (train), and testing (test) occurrences.

Examples

# arguments
occs <- read.csv(list.files(system.file("extdata", package = "kuenm"),
                            pattern = "sp_test.csv", full.names = TRUE))
occs <- data.frame(Species = "Species_1", occs)
train_prop <- 0.5

# running
occ_rsplit <- occ_randsplit(occ = occs, train.proportion = train_prop)

manubio13/ku.enm documentation built on Jan. 5, 2024, 5:55 a.m.