Description Usage Arguments Value See Also Examples
Given the output from runBRT and a rasterbrick of covariates to predict to, the function makes (and returns) a prediction to the rasters based on the fitted model from runBRT. The function will throw an error if the column names for the covariates used in runBRT do not match the prediction covariate names.
1 2 | makePreds(object,
pred_covs)
|
object |
Output from |
pred_covs |
A rasterbrick of covariates to predict to. |
A raster containing prediction values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # fit BRT model
example(runBRT)
# reload the covariate rasters
data(covariates)
# change names so function produces an error
prediction_covs <- covariates
names(prediction_covs)[names(prediction_covs)=='cov_c'] <- 'cov_d'
# get predictions
## Not run:
# this should produce an error - the columns are wrongly named
pred1 <- makePreds(model, prediction_covs)
## End(Not run)
pred2 <- makePreds(model, covariates)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.