Initialize a project with subdirectories cache/
, modules/
,
inputs/
, outputs/
, and setPaths
accordingly.
If invoked from Rstudio, will also create a new Rstudio project file.
newProject(name, path, open)
# S4 method for class 'character,character,logical'
newProject(name, path, open)
# S4 method for class 'character,character,missing'
newProject(name, path, open)
invoked for side effect of project file creation
myProjDir <- newProject("myProject", tempdir())
#> Setting:
#> options(
#> reproducible.cachePath = '/tmp/Rtmp45trFG/myProject/cache'
#> spades.inputPath = '/tmp/Rtmp45trFG/myProject/inputs'
#> spades.outputPath = '/tmp/Rtmp45trFG/myProject/outputs'
#> spades.modulePath = '/tmp/Rtmp45trFG/myProject/modules'
#> )
#> Paths set to:
#> options(
#> rasterTmpDir = '/tmp/Rtmp45trFG/SpaDES/scratch/raster'
#> reproducible.cachePath = '/tmp/Rtmp45trFG/myProject/cache'
#> spades.inputPath = '/tmp/Rtmp45trFG/myProject/inputs'
#> spades.outputPath = '/tmp/Rtmp45trFG/myProject/outputs'
#> spades.modulePath = '/tmp/Rtmp45trFG/myProject/modules'
#> spades.scratchPath = '/tmp/Rtmp45trFG/SpaDES/scratch'
#> )
#> terra::terraOptions(tempdir = '/tmp/Rtmp45trFG/SpaDES/scratch/terra'
dir.exists(file.path(myProjDir, "cache"))
#> [1] TRUE
dir.exists(file.path(myProjDir, "inputs"))
#> [1] TRUE
dir.exists(file.path(myProjDir, "modules"))
#> [1] TRUE
dir.exists(file.path(myProjDir, "outputs"))
#> [1] TRUE
unlink(myProjDir, recursive = TRUE) ## cleanup