Update Predictors for a RiskMap Prediction Object
update_predictors.Rd
This function updates the predictors of a given RiskMap prediction object. It ensures that the new predictors match the original prediction grid and updates the relevant components of the object accordingly.
Arguments
- object
A `RiskMap.pred.re` object, which is the output of the
pred_over_grid
function.- predictors
A data frame containing the new predictor values. The number of rows must match the prediction grid in the `object`.
Details
The function performs several checks and updates:
Ensures that `object` is of class `RiskMap.pred.re`.
Ensures that the number of rows in `predictors` matches the prediction grid in `object`.
Removes any rows with missing values in `predictors` and updates the corresponding components of the `object`.
Updates the prediction locations, the predictive samples for the random effects, and the linear predictor.