View source: R/kuenm_occsplit.R
occ_randsplit | R Documentation |
occ_randsplit splits a set of occurrences to obtain training and testing data randomly.
occ_randsplit(occ, train.proportion = 0.5)
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. |
List with all occurrences (joint), training occurrences (train), and testing (test) occurrences.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.