Converts a data.frame of species occurrences into input features to use a convolutional neural network to approximate species extinction risk.
iucnn_cnn_features(
x,
y = NULL,
species = "species",
lon = "decimallongitude",
lat = "decimallatitude",
crs_x = "+proj=longlat +datum=WGS84",
res_y = 1
)
a data.frame with at least three columns containing taxon name, decimal longitude and latitude values.
a SpatRaster object as reference to count the number of occurrence records in. Can be of any resolution and CRS but the coordinates in x need to be in the same CRS.
a character string. The name of the column with the species names.
a character string. The name of the column with the longitude.
a character string. The name of the column with the latitude.
a proj4string specifying the Coordinate Reference system of the coordinates in x. Default is to lat/lon WGS84.
numeric. The resolution for the raster in decimal degrees. Only relevant if y is not provided.
a list of matrices, one for each input species, where the cells represent the number
of occurrence records in this cell as input for the “cnn” class of iucnn_train_model
.
If y is not provided, assumes a lat/lon grid with extent equal to the respective minimum and maximum in x
Other Feature preparation:
iucnn_bias_features()
,
iucnn_biome_features()
,
iucnn_climate_features()
,
iucnn_footprint_features()
,
iucnn_geography_features()
,
iucnn_phylogenetic_features()
,
iucnn_prepare_features()
,
iucnn_prepare_phy()
if (FALSE) {
dat <- data.frame(species = c("A","B"),
decimallongitude = runif(200, 10, 15),
decimallatitude = runif(200, -5, 5))
iucnn_cnn_features(dat)
}