Converting IUCN category labels into numeric categories required by
iucnn_train_model
.
a data.frame or a list. If a data.frame, two columns with the species names and IUCN categories respectively. The column names are defined by the species and labels arguments. If a list, expecting the format as returned by rl_search.
object of class iucnn-features
or iucnn_cnn_features
.
Ensures that the species in the return value are in the same order as in y.
a character string. The name of the column with the species names in x.
a character string. The name of the column with the labels (assessment categories) in x.
a character string. The labels to be converted in to numeric values. Entries with labels not mentioned (e.g. "DD") will be removed. The numeric labels returned by the function will correspond to the order in this argument. For instance with default settings, LC -> 0, CR -> 4.
a character string. The level of output level detail. If "detail" full IUCN categories, if "broad" then 0 = Not threatened, and 1 = Threatened.
a character string. Only if level=="broad", Which labels to consider threatened.
a data.frame with species names and numeric labels
See vignette("Approximate_IUCN_Red_List_assessments_with_IUCNN")
for a tutorial on how to run IUCNN.
if (FALSE) {
dat <- data.frame(species = c("A", "B"),
decimallongitude = runif(200, 10, 15),
decimallatitude = runif(200, -5, 5))
labs <- data.frame(species = c("A", "B"),
labels = c("CR", "LC"))
features <- iucnn_prepare_features(dat,
type = "geographic")
iucnn_prepare_labels(x = labs,
y = features)
}