View source: R/kuenm_occsplit.R
kuenm_occsplit | R Documentation |
kuenm_occsplit splits occurrences contained in a data.frame to obtain training and testing data based on distinct methods for calibrating models.
kuenm_occsplit(occ, train.proportion = 0.5, method = "random",
save = FALSE, name = "occ")
occ |
data.frame of occurrence records containing at least species, longitude, and latitude columns. |
train.proportion |
(numeric) proportion (from 0 to 1) of data to be used as training occurrences. The remaining data will be used for testing. |
method |
(character) method for selecting training and testing occurrences. Current option is "random". |
save |
(logical) whether or not to save the results in the working directory. Default = FALSE. |
name |
(character) common name for csv files to be written. A suffix will be added depending on if the data is the complete set, training set, or testing set of occurrences. |
List with all, training, and testing occurrences. Three csv files will be written in the
working directory according to the name defined in name
plus the suffix _joint
for all records, _train for the training set, and _test for the testing set.
# arguments
data("sp_joint", package = "kuenm")
occs <- data.frame(Species = "A_americanum", sp_joint)
train_prop <- 0.5
method = "random"
# running
data_split <- kuenm_occsplit(occ = occs, train.proportion = train_prop,
method = method)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.