Will code all species in the input file into biomes based on an intersection of the coordinates with a shape file. The biome scheme can be user provided or by default will download the WWF biomes.

iucnn_biome_features(
  x,
  species = "species",
  lon = "decimallongitude",
  lat = "decimallatitude",
  biome_input = NULL,
  biome_id = "BIOME",
  download_folder = "feature_extraction",
  remove_zeros = FALSE
)

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.

biome_input

a simple features collection of geometry type polygon, contain polygons of different biomes. If NULL, the WWF biome scheme is downloaded from https://www.worldwildlife.org/publications/terrestrial-ecoregions-of-the-world

biome_id

a character string. The name of the column with the biome names in biome_input. Default is "BIOME"

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

remove_zeros

logical. If TRUE biomes without occurrence of any species are removed from the features. Default = FALSE

Value

a data.frame of climatic features

Details

If biome_input is NULL this will download the WWF biome scheme from https://www.worldwildlife.org/publications/terrestrial-ecoregions-of-the-world and save them in the working directory

Examples

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

iucnn_biome_features(dat)
}