Skip to content

Commit

Permalink
local terraOptions in readGPM2
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-sauer committed May 8, 2024
1 parent 3bf7775 commit 7829e6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/readGPM2.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
#' @importFrom magclass as.magpie

readGPM2 <- function() {
previousOptions <- terra::terraOptions(print = FALSE)
terra::terraOptions(tempdir = withr::local_tempdir(tmpdir = getConfig("tmpfolder")),
todisk = FALSE, memfrac = 0.5)
withr::defer(terra::terraOptions(tempdir = tempdir()))
withr::defer(do.call(terra::terraOptions, previousOptions))

# read-in file
r <- terra::rast("peatMAY22_1x1_mw_RUS30.tif")
Expand Down

0 comments on commit 7829e6a

Please sign in to comment.