identical.RdWhen, comparing two SpatRasters for equality, first the attributes of the objects are compared. If these are the same, a the raster cells are compared as well. This can be time consuming, and you may prefer to use a sample instead with all.equal
# S4 method for class 'SpatRaster,SpatRaster'
identical(x, y)
# S4 method for class 'SpatVector,SpatVector'
identical(x, y)
# S4 method for class 'SpatExtent,SpatExtent'
identical(x, y)single logical value