Skip to contents

This function samples land-use data either from species presence locations or from background locations within a specified geographic area.

Usage

SampleLanduse(DF, file, type = "pres")

Arguments

DF

A data frame containing species presence or background data, with columns for species, decimalLongitude, and decimalLatitude.

file

A string representing the path to a raster file that contains land-use data.

type

A string specifying whether to sample land-use data from species presences ("pres") or from background locations ("bg"). Defaults to "pres".

Value

A data frame with the sampled land-use data. The data frame contains columns for species, Landuse, and Pres, where Pres indicates whether the row corresponds to a presence (1) or background (0) point.