trim_abundances: Drop spp from abund dist if on too many or too few patches

trim_abundancesR Documentation

Drop spp from abund dist if on too many or too few patches

Description

This function is primarily to get rid of species that occur on only 0 or 1 patches, however, some distribution generator might also generate species that are too common as well, so this routine will axe those too.

Usage

trim_abundances(
  rounded_abundances,
  min_abund = 2,
  max_abund = .Machine$double.xmax
)

Arguments

rounded_abundances

vector of abundances to be trimmed

min_abund

lowest abundance to allow in the trimmed set

max_abund

largest abundance to allow in the trimmed set

Details

Abundances are expressed here as a vector of count values where each value is the count of the number of patches a particular species occurs on. For example, [1 1 1 2 6 6] would represent 3 species that occur on exactly one patch, 1 species that occurs on 2 patches, and 2 species that occur on 6 patches each. Calling this routine with a min_abund of 2 and a max_abund of 5 would return a 1 element vector, i.e., the vector [2].

This doesn't really need to be a function since it's only one line long, but I built an earlier version that was more verbose so that I could monitor how many things were being cut out. That version is in the git repository in case it needs to be resurrected for some reason.

Value

vector of abundances whose values lie in the specified range


langfob/bdpg documentation built on Dec. 8, 2022, 5:33 a.m.