Last class
- We saw how to add ‘pseudo-absences’ to a presence-only data set to
make modelling possible
This class
- How to do spatial cross validation on presence / pseudo-absence
data
- Talk about the final project
An example SDM
- Let’s run through a full SDM analysis
- We will use an example dataset in the
ENMTools
package
## Warning in cbind(`Feature ID` = fid, mat): number of rows of result is not a
## multiple of vector length (arg 1)
Sample Pseudo-Absences
monticola_dat <- sdm_data(monticola, bg = bg, n = 10000)
monticola_dat
## Simple feature collection with 10260 features and 2 fields
## Geometry type: POINT
## Dimension: XY
## Bounding box: xmin: -9.252936 ymin: 36.61092 xmax: 2.587413 ymax: 46.23354
## Geodetic CRS: WGS 84
## First 10 features:
## present pnt_origin pnts
## 1 present data POINT (-5.171215 43.06957)
## 2 present data POINT (-6.036635 43.02531)
## 3 present data POINT (-7.679727 40.38852)
## 4 present data POINT (-7.790437 40.30959)
## 5 present data POINT (-7.47334 43.78935)
## 6 present data POINT (-6.575039 42.9107)
## 7 present data POINT (-5.132756 43.49572)
## 8 present data POINT (-7.787378 40.39362)
## 9 present data POINT (-4.941888 43.3531)
## 10 present data POINT (-7.621731 40.3417)
mapview(monticola_dat, zcol = "present")
Add environmental variables
monticola_dat <- add_env_vars(monticola_dat, euro.worldclim)
monticola_dat
## Simple feature collection with 10260 features and 21 fields
## Geometry type: POINT
## Dimension: XY
## Bounding box: xmin: -9.252936 ymin: 36.61092 xmax: 2.587413 ymax: 46.23354
## Geodetic CRS: WGS 84
## First 10 features:
## present pnt_origin bio1 bio2 bio3 bio4 bio5 bio6 bio7 bio8 bio9 bio10 bio11
## 1 present data 78 100 40 5056 223 -26 249 52 145 146 18
## 2 present data 76 100 40 5052 220 -26 246 48 143 144 16
## 3 present data 137 94 38 5318 281 34 247 72 208 208 72
## 4 present data 129 88 36 5333 271 29 242 65 200 200 65
## 5 present data 140 76 42 3636 237 58 179 101 185 189 95
## 6 present data 84 99 40 5134 228 -19 247 28 152 152 23
## 7 present data 133 78 41 3998 235 45 190 115 184 186 84
## 8 present data 137 94 38 5318 281 34 247 72 208 208 72
## 9 present data 128 78 40 4073 233 39 194 111 180 183 78
## 10 present data 101 76 33 5359 236 7 229 39 173 173 39
## bio12 bio13 bio14 bio15 bio16 bio17 bio18 bio19 pnts
## 1 917 113 48 24 305 169 171 251 POINT (-5.171215 43.06957)
## 2 1012 128 46 28 345 166 171 302 POINT (-6.036635 43.02531)
## 3 1143 172 11 55 465 72 72 465 POINT (-7.679727 40.38852)
## 4 1231 187 12 56 504 76 76 504 POINT (-7.790437 40.30959)
## 5 931 122 32 34 336 122 142 298 POINT (-7.47334 43.78935)
## 6 1012 129 39 32 358 145 145 328 POINT (-6.575039 42.9107)
## 7 822 110 40 28 284 145 160 213 POINT (-5.132756 43.49572)
## 8 1143 172 11 55 465 72 72 465 POINT (-7.787378 40.39362)
## 9 843 111 41 27 291 149 164 222 POINT (-4.941888 43.3531)
## 10 1514 234 15 57 621 92 92 621 POINT (-7.621731 40.3417)