Skip to contents

This function performs the complete workflow for modeling habitat suitability for multiple species. It includes sampling land-use data for presence and background points separately, and then fitting a MaxEnt model to predict habitat suitability based on the available land-use types.

Usage

ModelAndPredictFunc(DF, file)

Arguments

DF

A data frame containing species presence data with columns for species name, longitude (decimalLongitude), and latitude (decimalLatitude).

file

A file path to the raster layer containing land-use data.

Value

A data frame with predicted habitat suitability scores for each land-use type for each species.

Details

The function encompasses several steps:

  1. Grouping the data by species using dplyr::group_split.

  2. Sampling land-use data for species presence points using the SampleLanduse function.

  3. Sampling land-use data for background points using the SampleLanduse function.

  4. Combining the presence and background data, and fitting a MaxEnt model to predict habitat suitability using the ModelSpecies function, which also handles the duplication of rows where necessary.