Builds the formula of both the abiotic and biotic terms to fit a single species SDM based on the input parameters. The function is called inside the SDMfit function

buildFormula(
  form.init,
  species,
  sp.formula = NULL,
  sp.partition = NULL,
  useBRMS
)

Arguments

form.init

The abiotic part of the formula

species

The preys (or predators) of the focal species

sp.formula

optional parameter for composite variables. See ?trophicSDM

sp.partition

optional parameter to specify groups of species for composite variables. See ?trophicSDM

useBRMS

whether brms is used (TRUE if penal = "coeff.signs" and method = "stan_glm).

Author

Giovanni Poggiato and Jérémy Andréoletti