Skip to content

Commit

Permalink
Merge pull request #330 from rhijmans/master
Browse files Browse the repository at this point in the history
use stable terra user interface
  • Loading branch information
MayaGueguen committed Sep 11, 2023
2 parents ee9734d + 57393bf commit 5794211
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions R/biomod2_classes_4.R
Original file line number Diff line number Diff line change
Expand Up @@ -819,9 +819,14 @@ setMethod('predict2', signature(object = 'MAXENT_biomod2_model', newdata = "Spat
proj <- rast(proj.spdf)

# Remi 11/2022 Not sure the following lines are necessary
if (!inMemory(proj)) {
proj <- proj@ptr$readAll() # to prevent from tmp files removing
x <- message(proj, "readAll") # to have message if need be ?
## RH: I doubt that they are. In fact, I would recommend against them
## if the file raster data go to disk it is because of memory limitations
## forcing them back into memory could be risky.
if (!inMemory(proj)[1]) {
##RH: @ptr$... is not part of the stable user interface
## proj <- proj@ptr$readAll() # to prevent from tmp files removing
## x <- message(proj, "readAll") # to have message if need be ?
readAll(proj)
}

if (on_0_1000) {
Expand Down

0 comments on commit 5794211

Please sign in to comment.