This function compare the area occupied by a species before and after pass through the cleaning procedure according to the chosen level of filter. The comparison can be made by measuring area in the geographical and in the environmental space

clean_eval(,, = NULL,
  level.filter = c("1_det_by_spec"),
  species = "species",
  decimal.longitude = "decimalLongitude",
  decimal.latitude = "decimalLatitude",,


data frame with occurrence records information already classified by classify_occ function.

a SpatialPolygons* or sf object defining the geographical space

a SpatialPolygons* or sf object defining the environmental space. Use the define_env_space for create this object. By default = NULL, hence do not evaluate the cleaning in the environmental space.


a character vector including the levels in 'naturaList_levels' column which filter the occurrence data set.


a raster with 2 layers representing the environmental variables. If = NULL, it could be a single layer raster, from which the cell size and extent are extracted to produce the composition matrix.


column name of with the species names.


column name of longitude in decimal degrees.


column name of latitude in decimal degrees.

deprecated, use species instead.


deprecated, use decimal.longitude instead


deprecated, use decimal.latitude instead


a list in which:

area data frame remaining area after cleaning proportional to the area before cleaning. The values vary from 0 to 1. Column named r.geo.area is the remaining area for all species in the geographic space and the r.env.area in the environmental space.

comp data frame with composition of species in sites (cells from raster layers) before cleaning (comp$comp$BC) and after cleaning (comp$comp$AC). The number of rows is equal the number of cells in r, and number of columns is equal to the number of species in the

rich data frame with a single column with the richness of each site

site.coords data frame with site's coordinates. It facilitates to built raster layers from results using rasterFromXYZ

See also


if (FALSE) { library(sp) library(raster) data("speciaLists") # list of specialists data("") # occurrence dataset # classify <- classify_occ(, speciaLists) # delimit the geographic space # land area data("BR") # Transform occurrence data in SpatialPointsDataFrame <- sp::SpatialPoints([, c("decimalLongitude", "decimalLatitude")]) # load climate data data("r.temp.prec") # mean temperature and annual precipitation df.temp.prec <- ### Define the environmental space for analysis # this function will create a boundary of available environmental space, # analogous to the continent boundary in the geographical space <- define_env_space(df.temp.prec, buffer.size = 0.05) # filter by year to be consistent with the environmental data occ.class.1970 <- %>% dplyr::filter(year >= 1970) ### run the evaluation cl.eval <- clean_eval(occ.class.1970, =, = BR, r = r.temp.prec) #area results head(cl.eval$area) ### richness maps ## it makes sense if there are more than one species rich.before.clean <- raster::rasterFromXYZ(cbind(cl.eval$site.coords, cl.eval$rich$rich.BC)) rich.after.clean <- raster::rasterFromXYZ(cbind(cl.eval$site.coords, cl.eval$rich$rich.AC)) raster::plot(rich.before.clean) raster::plot(rich.after.clean) ### species area map comp.bc <-$comp$comp.BC) <-$comp$comp.AC) c.villosa.bc <- raster::rasterFromXYZ(cbind(cl.eval$site.coords, comp.bc$`Cyathea villosa`)) <- raster::rasterFromXYZ(cbind(cl.eval$site.coords,$`Cyathea villosa`)) raster::plot(c.villosa.bc) raster::plot( }