You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to extract the variables importance and map the model prediction of models fitted using presence-only. However, the following errors pop-up:
for the getVarImp() function -> Error in o[[1]] : subscript out of bounds
for the predict() function -> Error in .generateWLP(x = object, newdata = newdata, w = w, species = species, : the data does not contain some or all of the variables that the model needs...
I include a reproducible example:
library(sdm)
file <- system.file("external/po_spatial_points.shp", package="sdm") # path to a shapefile
po <- shapefile(file)
class(po)
head(po)
path <- system.file("external", package="sdm")
lst <- list.files(path=path,pattern='asc$',full.names = T)
preds <- stack(lst) # making a raster object
d <- sdmData(formula=sp4~., train=po, predictors=preds)
d
m <- sdm(sp4~., data=d, methods=c("bioclim","domain"),
replication='sub', test.percent=30, n=10)
getModelInfo(m)
getVarImp(m)
p1 <- predict(m, newdata=preds)
There is an easy fix for this issue?
Thank you!
The text was updated successfully, but these errors were encountered:
I understand that the methods you selected are presence-only, but it would currently be better to generate background as well, because they would be needed for model evaluations, so adding bg to sdmData would fix the issue.
d <- sdmData(formula=sp4~., train=po, predictors=preds,bg=list(n=100))
Dear Babak,
I'm trying to extract the variables importance and map the model prediction of models fitted using presence-only. However, the following errors pop-up:
I include a reproducible example:
There is an easy fix for this issue?
Thank you!
The text was updated successfully, but these errors were encountered: