Calculate the size of pixel clumps in a RasterLayer. The clump area is assigned to each clump, and araster with identical dimensions, but values representing the clump size is output. The definition of a pixel clump follows that of clump
, where diagonals are either included or ignored in defining clumps. An optional conversion factor can be supplied based on pixel size.
clumpSize(x, f = 1, stats = FALSE, ...)
RasterLayer.
Numeric. Optional: conversion factor for number of pixels (e.g. f=900/10000 for converting Landsat pixels to area in hectares).
Logical. Include summary statistics per clump? If TRUE, a list with (1) a raster layer showing clump sizes and (2) a summary table per clump. If FALSE, only a raster layer is returned.
Additional arguments to pass to clump
If stats=FALSE
, a raster layer with pixel values indicating the size of the clumps to which those pixels belong. If stats=TRUE
, a list with 2 objects: (1) a raster layer as above; and (2) a summary table of the pixel clump sizes.
Note that if stats=TRUE
, a summary table is also produced. This table is not the same table that would result if the resulting raster was passed to summary
. The summary table in this case is based on pixel clumps, rather than individual pixel values. The conversion factor f
is also factored into the summary table.