Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in the sdm::ensemble() function in GNU/Linux Ubuntu #27

Open
mauriciovancine opened this issue Jun 27, 2024 · 0 comments
Open

Error in the sdm::ensemble() function in GNU/Linux Ubuntu #27

mauriciovancine opened this issue Jun 27, 2024 · 0 comments

Comments

@mauriciovancine
Copy link

Dear,

I'm trying without success to find the error in the ensemble() function in GNU/Linux Ubuntu.

Could you indicate a way to find the error?

Thanks!

Running the function example:

# library
library(sdm)

# data
file <- system.file("external/species.shp", package="sdm") # get the location of the species data
species <- vect(file) # read the shapefile
path <- system.file("external", package="sdm") # path to the folder contains the data
lst <- list.files(path=path,pattern='asc$',full.names = T) # list the name of the raster files

# stack is a function in the raster package, to read/create a multi-layers raster dataset
preds <- rast(lst) # making a raster object

d <- sdmData(formula=Occurrence~., train=species, predictors=preds)
d

# fit the models (5 methods, and 10 replications using bootstrapping procedure):
m <- sdm(Occurrence~.,data=d,methods=c('rf','tree','fda','mars','svm'),
 replicatin='boot',n=10)

# ensemble using weighted averaging based on AUC statistic:
p1 <- ensemble(m, newdata=preds, filename='ens.tif',setting=list(method='weighted',stat='AUC'))

Error in .canProcessInMemory(.out[[1]], max(nlyr(.out), nlyr(newdata)) * :
 in the slot of name "cpp" for this object of class "SpatRaster"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant