Is there an equivalent of the ESRI spatial analyst "Region group" command in one of the r packages that handles rasters ie function that assigns a unique id all cells of a contiguous area of the same value Thanks Nevil amos