prepareGradient function

prepareGradient

prepareGradient

prepares a user-made environmental and/or spatial gradient to be used for prediction

prepareGradient(hM, XDataNew, sDataNew)

Arguments

  • hM: a fitted Hmsc model object.
  • XDataNew: a dataframe of the new XData.
  • sDataNew: a named list of the new sData, where the name gives the spatial random level.

Returns

a named list with members XDataNew, studyDesignNew and rLNew

Details

The dataframe XDataNew is the for output as for input. The main purpose of this function is to prepare the study design and random levels so that predictions can be made with the predict function. Note that the difference between constructGradient and prepareGradient is that while prepareGradient takes as input the new environmental and spatial data, constructGradient

generates those data to represent a new environmental gradient.

See Also

constructGradient, predict

  • Maintainer: Otso Ovaskainen
  • License: GPL-3 | file LICENSE
  • Last published: 2022-08-11