Compute area of polygons or and the surfacer area or raster cells.
Computing the surface area of raster cells is only relevant for longitude/latitude rasters. For planar data, the cell area is constant, can be computed with prod(res(x)). For polygons, the area of each geometry is returned.
The perimeter method works only on SpatVector objects, and computes the length of lines or the perimeter of polygons.