With grid_filter() you may filter occurrence records inside grid cells in order to keep only the record with the highest confidence level in each grid cell.

Fig. 1 - The procedure of grid_filter() to select the record with the highest confidence level in each grid cell

As example, we will filter the occ.class in square grid cells of 0.5 decimal degree of side, which is the default grid cell size of grid_filter(). You can provide the height and width of the grid cell in grid.resolution argument, or provide a raster layer in argument r from which the cell is used to filter occurrences.

# Load package and data
library(naturaList)

data("A.setosa")
data("speciaLists")

# classification
occ.class <- classify_occ(A.setosa, speciaLists)

# grid filtering
occ.grid <- grid_filter(occ.class)

dim(occ.grid)
table(occ.grid$naturaList_levels)