Wrapper functions to access the packages options for default working directories.
Note: there is an active binding made to Paths, so a user can use
Paths$cachePath for example instead of getPaths()$cachePath
.paths()
getPaths()
Paths
setPaths(
cachePath,
inputPath,
modulePath,
outputPath,
rasterPath,
scratchPath,
terraPath,
silent = FALSE
)An object of class list of length 7.
The default local directory in which to cache simulation outputs.
If not specified, defaults to getOption("reproducible.cachePath").
The default local directory in which to look for simulation inputs
If not specified, defaults to getOption("spades.inputPath").
The default local directory where modules and data will be
downloaded and stored.
If not specified, defaults to getOption("spades.modulePath").
The default local directory in which to save simulation outputs.
If not specified, defaults to getOption("spades.outputPath").
The default local directory in which to save transient raster files.
If not specified, defaults to
file.path(getOption("spades.scratchPath"), "raster").
Important note: this location may not be cleaned up automatically,
so be sure to monitor this directory and remove unnecessary temp files
that may contribute to excessive disk usage.
This option will be deprecated in a future release.
The default local directory in which to save transient files.
If not specified, defaults to getOption("spades.scratchPath").
Important note: this location may not be cleaned up automatically,
so be sure to monitor this directory and remove unnecessary temp files
that may contribute to excessive disk usage.
The default local directory in which to save transient terra files.
If not specified, defaults to
file.path(getOption("spades.scratchPath"), "terra").
Important note: this location may not be cleaned up automatically,
so be sure to monitor this directory and remove unnecessary temp files
that may contribute to excessive disk usage.
Logical. Should the messaging occur.
getPaths returns a named list of the user's default working directories.
setPaths is invoked for the side effect of setting these directories.
# \donttest{
getPaths() ## returns the current default working paths
#> $cachePath
#> [1] "/tmp/RtmpXxjf07/myProject/cache"
#>
#> $inputPath
#> [1] "/tmp/RtmpXxjf07/myProject/inputs"
#>
#> $modulePath
#> [1] "/tmp/RtmpXxjf07/myProject/modules"
#>
#> $outputPath
#> [1] "/tmp/RtmpXxjf07/myProject/outputs"
#>
#> $rasterPath
#> [1] "/tmp/RtmpXxjf07/SpaDES/scratch/raster"
#>
#> $scratchPath
#> [1] "/tmp/RtmpXxjf07/SpaDES/scratch"
#>
#> $terraPath
#> [1] "/tmp/RtmpXxjf07/SpaDES/scratch/terra"
#>
## set individual custom paths
setPaths(cachePath = file.path(tempdir(), "cache"))
#> Setting:
#> options(
#> reproducible.cachePath = '/tmp/RtmpXxjf07/cache'
#> )
#> Paths set to:
#> options(
#> rasterTmpDir = '/tmp/RtmpXxjf07/SpaDES/scratch/raster'
#> reproducible.cachePath = '/tmp/RtmpXxjf07/cache'
#> spades.inputPath = '/tmp/RtmpXxjf07/myProject/inputs'
#> spades.outputPath = '/tmp/RtmpXxjf07/myProject/outputs'
#> spades.modulePath = '/tmp/RtmpXxjf07/myProject/modules'
#> spades.scratchPath = '/tmp/RtmpXxjf07/SpaDES/scratch'
#> )
#> terra::terraOptions(tempdir = '/tmp/RtmpXxjf07/SpaDES/scratch/terra'
setPaths(inputPath = file.path(tempdir(), "inputs"))
#> Setting:
#> options(
#> spades.inputPath = '/tmp/RtmpXxjf07/inputs'
#> )
#> Paths set to:
#> options(
#> rasterTmpDir = '/tmp/RtmpXxjf07/SpaDES/scratch/raster'
#> reproducible.cachePath = '/tmp/RtmpXxjf07/cache'
#> spades.inputPath = '/tmp/RtmpXxjf07/inputs'
#> spades.outputPath = '/tmp/RtmpXxjf07/myProject/outputs'
#> spades.modulePath = '/tmp/RtmpXxjf07/myProject/modules'
#> spades.scratchPath = '/tmp/RtmpXxjf07/SpaDES/scratch'
#> )
#> terra::terraOptions(tempdir = '/tmp/RtmpXxjf07/SpaDES/scratch/terra'
setPaths(modulePath = file.path(tempdir(), "modules"))
#> Setting:
#> options(
#> spades.modulePath = '/tmp/RtmpXxjf07/modules'
#> )
#> Paths set to:
#> options(
#> rasterTmpDir = '/tmp/RtmpXxjf07/SpaDES/scratch/raster'
#> reproducible.cachePath = '/tmp/RtmpXxjf07/cache'
#> spades.inputPath = '/tmp/RtmpXxjf07/inputs'
#> spades.outputPath = '/tmp/RtmpXxjf07/myProject/outputs'
#> spades.modulePath = '/tmp/RtmpXxjf07/modules'
#> spades.scratchPath = '/tmp/RtmpXxjf07/SpaDES/scratch'
#> )
#> terra::terraOptions(tempdir = '/tmp/RtmpXxjf07/SpaDES/scratch/terra'
setPaths(outputPath = file.path(tempdir(), "outputs"))
#> Setting:
#> options(
#> spades.outputPath = '/tmp/RtmpXxjf07/outputs'
#> )
#> Paths set to:
#> options(
#> rasterTmpDir = '/tmp/RtmpXxjf07/SpaDES/scratch/raster'
#> reproducible.cachePath = '/tmp/RtmpXxjf07/cache'
#> spades.inputPath = '/tmp/RtmpXxjf07/inputs'
#> spades.outputPath = '/tmp/RtmpXxjf07/outputs'
#> spades.modulePath = '/tmp/RtmpXxjf07/modules'
#> spades.scratchPath = '/tmp/RtmpXxjf07/SpaDES/scratch'
#> )
#> terra::terraOptions(tempdir = '/tmp/RtmpXxjf07/SpaDES/scratch/terra'
setPaths(scratchPath = file.path(tempdir(), "scratch"))
#> Setting:
#> options(
#> spades.scratchPath = '/tmp/RtmpXxjf07/scratch'
#> )
#> Paths set to:
#> options(
#> rasterTmpDir = '/tmp/RtmpXxjf07/SpaDES/scratch/raster'
#> reproducible.cachePath = '/tmp/RtmpXxjf07/cache'
#> spades.inputPath = '/tmp/RtmpXxjf07/inputs'
#> spades.outputPath = '/tmp/RtmpXxjf07/outputs'
#> spades.modulePath = '/tmp/RtmpXxjf07/modules'
#> spades.scratchPath = '/tmp/RtmpXxjf07/scratch'
#> )
#> terra::terraOptions(tempdir = '/tmp/RtmpXxjf07/SpaDES/scratch/terra'
# NOTE: on loading and attaching SpaDES.core,
# an active binding is made to "Paths"
getPaths()
#> $cachePath
#> [1] "/tmp/RtmpXxjf07/cache"
#>
#> $inputPath
#> [1] "/tmp/RtmpXxjf07/inputs"
#>
#> $modulePath
#> [1] "/tmp/RtmpXxjf07/modules"
#>
#> $outputPath
#> [1] "/tmp/RtmpXxjf07/outputs"
#>
#> $rasterPath
#> [1] "/tmp/RtmpXxjf07/scratch/raster"
#>
#> $scratchPath
#> [1] "/tmp/RtmpXxjf07/scratch"
#>
#> $terraPath
#> [1] "/tmp/RtmpXxjf07/scratch/terra"
#>
Paths ## same as getPaths() above
#> $cachePath
#> [1] "/tmp/RtmpXxjf07/cache"
#>
#> $inputPath
#> [1] "/tmp/RtmpXxjf07/inputs"
#>
#> $modulePath
#> [1] "/tmp/RtmpXxjf07/modules"
#>
#> $outputPath
#> [1] "/tmp/RtmpXxjf07/outputs"
#>
#> $rasterPath
#> [1] "/tmp/RtmpXxjf07/scratch/raster"
#>
#> $scratchPath
#> [1] "/tmp/RtmpXxjf07/scratch"
#>
#> $terraPath
#> [1] "/tmp/RtmpXxjf07/scratch/terra"
#>
setPaths(outputPath = tempdir())
#> Setting:
#> options(
#> spades.outputPath = '/tmp/RtmpXxjf07'
#> )
#> Paths set to:
#> options(
#> rasterTmpDir = '/tmp/RtmpXxjf07/scratch/raster'
#> reproducible.cachePath = '/tmp/RtmpXxjf07/cache'
#> spades.inputPath = '/tmp/RtmpXxjf07/inputs'
#> spades.outputPath = '/tmp/RtmpXxjf07'
#> spades.modulePath = '/tmp/RtmpXxjf07/modules'
#> spades.scratchPath = '/tmp/RtmpXxjf07/scratch'
#> )
#> terra::terraOptions(tempdir = '/tmp/RtmpXxjf07/scratch/terra'
Paths # shows change
#> $cachePath
#> [1] "/tmp/RtmpXxjf07/cache"
#>
#> $inputPath
#> [1] "/tmp/RtmpXxjf07/inputs"
#>
#> $modulePath
#> [1] "/tmp/RtmpXxjf07/modules"
#>
#> $outputPath
#> [1] "/tmp/RtmpXxjf07"
#>
#> $rasterPath
#> [1] "/tmp/RtmpXxjf07/scratch/raster"
#>
#> $scratchPath
#> [1] "/tmp/RtmpXxjf07/scratch"
#>
#> $terraPath
#> [1] "/tmp/RtmpXxjf07/scratch/terra"
#>
# }