Generates unique groupings of a data.table object where one or more rows can all belong to the same pixelIndex. Pixel groups will be identical pixels based on unique combinations of columns.

generatePixelGroups(
  pixelDataTable,
  maxPixelGroup,
  columns = c("ecoregionGroup", "speciesCode", "age", "B")
)

Arguments

pixelDataTable

A data.table with column-based descriptions. Must have a column called pixelIndex, which allows for multiple rows to be associated with a single pixel.

maxPixelGroup

A length 1 numeric indicating the current maximum pixelGroup value; the pixelGroup numbers returned will start at maxPixelGroup + 1.

columns

A character vector of column names to use as part of the generation of unique combinations of features. Default is c("ecoregionGroup", "speciesCode", "age", "B")

Value

Returns a vector of pixelGroup in the original order of the input pixelDataTable. This should likely be added to the pixelDataTable object immediately.