A wrapper function to prepare all default features included in IUCNN: geographic, biomes, climate, human footprint. If desired, bias features need to be calculated separately with ft_bias. For more control over feature preparation, you can use the iucnn_geography_features, iucnn_biome_features, iucnn_climate_features, iucnn_footprint_features functions.

iucnn_prepare_features(
  x,
  species = "species",
  lon = "decimallongitude",
  lat = "decimallatitude",
  type = c("geographic", "biomes", "climate", "humanfootprint"),
  download_folder = "feature_extraction",
  impute_features = TRUE
)

Arguments

x

a data.frame of species occurrence records including three columns with species name, longitudinal coordinates and latitudinal coordinates (both decimal).

species

a character string. The name of the column with the species names.

lon

a character string. The name of the column with the longitude.

lat

a character string. The name of the column with the latitude.

type

character. The type of features to calculate. Possible options are “geographic”, “biome”, “climate”, “human footprint”.

download_folder

character string. The folder were to save the data used for feature extraction. Relative to the working directory. Set to NULL for the working directory

impute_features

logical. Should NA values be imputed for features? If TRUE NA values are filled using multiple imputation using missForest. If set to FALSE species with missing values are removed during the training process.

Value

a data.frame of features

Details

Without internet access, only geographic features are calculated,

Examples

if (FALSE) {
dat <- data.frame(species = c("A","B"),
                  decimallongitude = runif (200,10,15),
                  decimallatitude = runif (200,-5,5))

iucnn_prepare_features(dat)
}