Where a LandWeb species group merges several species, keeps only the trait code (LANDIS_traits) of the member with the most cover, and blanks the others, so that LandR::prepSpeciesTable() and LandR::speciesTableUpdate() take the group's traits from that one member.

landweb_dominant_sppEquiv(sppEquiv, cover)

Arguments

sppEquiv

data.table from landweb_sppEquiv(), with SCANFI, LANDIS_traits and LandWeb columns. It is not modified.

cover

named numeric vector of total cover by SCANFI code, as from landweb_member_cover().

Value

A copy of sppEquiv with the non-dominant members' LANDIS_traits set to NA. Attribute "dominant" is a data.table of each group's dominant trait code and its share of the group's cover.

Details

Both LandR functions give a group the minimum of each numeric trait across its members' LANDIS_traits codes. For LandWeb's Pice_gla (white, Engelmann and hybrid spruce) that meant Engelmann spruce's 30 m effective seed dispersal for a group that is mostly white spruce (100 m). A member's cover is summed over the rows that share its LANDIS_traits code (the hybrid spruce shares Engelmann spruce's), so rows with the dominant code keep it. A group with one trait code, or with no cover at all in the study area, is left unchanged. Rows without a SCANFI code (see landweb_sppEquiv()) contribute no cover, and keep their code only if it is the dominant one.