Closed jamiemkass closed 4 months ago
@rhijmans Wondering if you had an idea for how to use predict when it's called in other packages. Thanks.
I think the problem has now been solved (by exporting predicts::predict
). I can now do:
f <- list.files(path=paste(system.file(package="dismo"), '/ex', sep=''), pattern='grd', full.names=TRUE )
preds <- terra::rast(f)
preds$biome <- terra::as.factor(preds$biome)
occurence <- system.file("/ex/bradypus.csv", package="predicts")
occ <- read.csv(occurence)[,-1]
me <- predicts::MaxEnt(preds, occ)
r1 <- terra::predict(preds, me)
r2 <- predicts::predict(me, preds)
terra::plot(r1)
terra::plot(r2)
Awesome! Thanks very much for this edit. This will make predictions with predicts
much easier to implement. Do you have an approximate date for updating the new pkg version for CRAN?
Hello, thanks for the great update to
dismo
. I hope you keep building this out to include updates for otherdismo
functions we've been using for years.Preface: I am not an expert on R objects, just an amateur, so I might be doing something wrong.
I am trying to update my package
ENMeval
to usepredicts
and I am running into an issue with thepredict()
S4 method. It seems I need to load thepredicts
package in order to use it. I also cannot figure out how to load this method in NAMESPACE. My maxent.jar models do predict fine usingMaxEnt
objects after I loadpredicts
. But I would prefer not to have to addpredicts
to Depends in the DESCRIPTION file. For example,maxnet
objects work fine with the genericpredict()
, but not MaxEnt objects.Can you advise on how we are supposed to use
predict()
forMaxEnt
and otherpredicts
model objects in other packages?Thanks for the help,
Jamie