iucnn_prepare_features: Prepare features for an IUCNN model

View source: R/iucnn_prepare_features.R

iucnn_prepare_featuresR Documentation

Prepare features for an IUCNN model

Description

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.

Usage

iucnn_prepare_features(
  x,
  species = "species",
  lon = "decimallongitude",
  lat = "decimallatitude",
  type = c("geographic", "biomes", "climate", "humanfootprint"),
  download_folder = tempdir(),
  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.

Details

Without internet access, only geographic features are calculated,

Value

a data.frame of features

See Also

Other Feature preparation: iucnn_bias_features(), iucnn_biome_features(), iucnn_climate_features(), iucnn_cnn_features(), iucnn_footprint_features(), iucnn_geography_features(), iucnn_phylogenetic_features(), iucnn_prepare_phy()

Examples

## Not run: 
dat <- data.frame(species = c("A","B"),
                  decimallongitude = runif (200,10,15),
                  decimallatitude = runif (200,-5,5))

iucnn_prepare_features(dat)

## End(Not run)

azizka/IUCNN documentation built on March 29, 2024, 9:38 a.m.