# NOT RUN {
#Download the presence data
data('ctenocidaris.nutrix')
occ <- ctenocidaris.nutrix
# select longitude and latitude coordinates among all the information
occ <- ctenocidaris.nutrix[,c('decimal.Longitude','decimal.Latitude')]
#Download some environmental predictors
data(predictors2005_2012)
envi <- predictors2005_2012
envi
#Create a SDMtab matrix
SDMtable_ctenocidaris <- SDMPlay:::SDMtab(xydata=occ,
predictors=predictors2005_2012,
unique.data=FALSE,
same=TRUE)
#Run the model
model <- SDMPlay:::compute.brt(x=SDMtable_ctenocidaris, proj.predictors=envi,lr=0.0005)
#Plot the partial dependance plots
dismo::gbm.plot(model$response)
#Get the contribution of each variable to the model
model$response$contributions
#Get the interaction between variables
dismo::gbm.interactions(model$response)
#Plot some interactions
int <- dismo::gbm.interactions(model$response)
dismo::gbm.perspec(model$response,int$rank.list[1,1],int$rank.list[1,3])
#Plot the map prediction
library(grDevices) # add nice colors
palet.col <- colorRampPalette(c('deepskyblue','green','yellow', 'red'))( 80 )
raster::plot(model$raster.prediction, col=palet.col,
main="Prediction map of Ctenocidaris nutrix distribution")
data('worldmap')
#add data
points(worldmap, type="l")
points(occ, col='black',pch=16)
REMARK: see more examples in the vignette tutorials
# }
Run the code above in your browser using DataLab