makePreds: Using the model output from 'runBRT', makes a prediction to a...

Description Usage Arguments Value See Also Examples

Description

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.

Usage

1
2
makePreds(object,
          pred_covs)

Arguments

object

Output from runBRT.

pred_covs

A rasterbrick of covariates to predict to.

Value

A raster containing prediction values.

See Also

runBRT

Examples

 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)

SEEG-Oxford/seegSDM documentation built on May 9, 2019, 11:08 a.m.