if (FALSE) {
# if m is a sdmModels object (output of the sdm function) then:
getVarImp(m,id=1) # variable importance
vi <- getVarImp(m,id=1)
vi
plot(vi,'auc')
plot(vi,'cor')
#############
# You can get Mean variable importance (and confidence interval) for multiple models:
vi <- getVarImp(m,id=1:10) # specify the modelIDs of the models
vi
plot(vi,'cor')
#----
# you can use the getModelId function to find the id of the specific method, replication, etc.
# or you may put the arguments of the getModelId in the getVarImp function:
vi <- getVarImp(m, method='glm') # Mean variable importance for the method glm
vi
plot(vi)
#################
##### Variable Importance based on ENSEMBLE:
# You can get variable importance based on the ensemble of multiple models:
# setting is passed to the ensemble function
vi <- getVarImp(m,id="ensemble",setting=list(method='weighted',stat='auc'))
vi
plot(vi,'cor')
#----------------
# if you want the ensemble based on a subset of models, you can define
# the id within the setting list:
vi <- getVarImp(m,id="ensemble",
setting=list(method='weighted',stat='auc',id=1:10))
vi
plot(vi,'cor')
plot(vi, gg = F) # R standard plot is used instead of ggplot
}
Run the code above in your browser using DataLab