Recode cohorts' species to their groups

recode_cohorts(cohortData, map)

Arguments

cohortData

data.table of cohorts with columns pixelGroup, speciesCode and B. It is not modified.

map

named character vector from species code to group, as sppEquiv_groups()$map.

Value

A new data.table with columns pixelGroup, speciesCode (now the group) and B, ready for LandR::vegTypeMapGenerator() with sppEquiv_groups()$groups. It is an error for a cohort's species to have no group.