代码如下:
library(sdm)
library(usdm)
library(rgdal)
path<-('C:/Users/11054/Documents/ArcGIS/bio1-19-9')
file<-paste("C:/Users/11054/Documents/ArcGIS/bio1-19-9/Export_Output.shp")
file
species <- shapefile(file)
class(species)
plot(species)
head(species)
plot(species[species$Occurrence == 1,],col='blue',pch=16)
lst<-list.files(path=path,pattern='asc$',full.names=T)
lst
preds <- stack(lst)
preds
library(sdm)
install.packages('rJava')
d <- sdmData(formula= ~., train=species, predictors=preds)
d
m1 <- sdm(Occurrence~.,data=d,methods=c('glm','gam','brt'))
m1
到m1报错如下:
> m1
class : sdmModels
========================================================
number of species : 1
number of modelling methods : 3
names of modelling methods : glm, gam, brt
------------------------------------------
model run success percentage (per species) :
------------------------------------------
method Occurrence
----------------------
glm : 0 %
gam : 0 %
brt : 100 %
###################################################################
Error in if (wtest == "test.dep") cat("model performance (per species), using test dataset (generated using partitioning):\n") else if (wtest == :
missing value where TRUE/FALSE needed