## S3 method for class 'RasterLayer':
area(x, filename="", na.rm=FALSE, weights=FALSE, ...)
## S3 method for class 'RasterStackBrick':
area(x, filename="", na.rm=FALSE, weights=FALSE, ...)
TRUE
, cells that are NA
are ignoredTRUE
, the area of each cells is divided by the total area of all cells that are not NA
writeRaster
weights=TRUE
x
is a RasterStack/Brick, a RasterBrick will be returned if na.rm=TRUE
. However, if na.rm=FALSE
, a RasterLayer is returned, because the values would be the same for all layers.r <- raster(nrow=18, ncol=36)
a <- area(r)
Run the code above in your browser using DataLab