exclude: Excluding variables specified in a VIF object

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Phisically exclude the collinear variables which are identified using vifcor or vifstep from a set of variables.

Usage

1

Arguments

x

explanatory variables (predictors), defined as a raster object (RasterStack or RasterBrick), or as a matrix, or as a data.frame.

vif

an object of class VIF, resulted from vifcor or vifstep functions.

...

additional argument as in vifstep

Details

Before using this function, you should execute one of vifstep or vifcor which detect collinearity based on calculating variance inflation factor (VIF) statistics. If vif is missing, then vifstep is called.

Value

an object of class same as x (i.e. RasterStack or RasterBrick or data.frame or matrix)

Author(s)

Babak Naimi [email protected]

http://r-gis.net

References

IF you used this method, please cite the following article for which this package is developed:

Naimi, B., Hamm, N.A.S., Groen, T.A., Skidmore, A.K., and Toxopeus, A.G. 2014. Where is positional uncertainty a problem for species distribution modelling?, Ecography 37 (2): 191-203.

See Also

vif

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## Not run: 
file <- system.file("external/spain.grd", package="usdm")

r <- brick(file) # reading a RasterBrick object including 10 raster layers in Spain

r 

vif(r) # calculates vif for the variables in r

v1 <- vifcor(r, th=0.9) # identify collinear variables that should be excluded

v1

re1 <- exclude(r,v1) # exclude the collinear variables that were identified in 
# the previous step

re1

v2 <- vifstep(r, th=10) # identify collinear variables that should be excluded

v2

re2 <- exclude(r, v2) # exclude the collinear variables that were identified in 
# the previous step

re2

re3 <- exclude(r) # first, vifstep is called 


re3

## End(Not run)

usdm documentation built on June 26, 2017, 3 a.m.