Learn R Programming

rdwd (version 1.8.0)

locdir: local data directory

Description

This can be used to set a directory for DWD data across projects, thus avoiding multiple downloads of the same file.
Set the default for all subsequent calls with options(rdwdlocdir="YOUR/PATH").
Currently, the dataDWD() dir defaults to a project specific folder at getwd. In the future, this may change to locdir().
locdir() is used especially for the website, local tests and examples.

Usage

locdir(dir = getOption("rdwdlocdir"), file = NULL, quiet = rdwdquiet())

Value

charstring (directory)

Arguments

dir

Path to data directory. If dir does not exist, tempdir() is used instead (with a warning, unless quiet=TRUE). If dir is NULL, locdir tries "C:/DWDdata", then "~/DWDdata".
dir can also be set with options(rdwdlocdir="YOUR/PATH") thanks to the DEFAULT: getOption("rdwdlocdir")

file

Optional: path(s) at dir. DEFAULT: NULL

quiet

Logical: suppress tempdir warning? DEFAULT: FALSE through rdwdquiet()

Author

Berry Boessenkool, berry-b@gmx.de, Apr 2019, Jun 2021

See Also

runLocalTests()

Examples

Run this code
locdir()
oldopt <- options(rdwdlocdir="~")
locdir()
stopifnot(locdir() == path.expand("~"))
options(oldopt) ; rm(oldopt)

Run the code above in your browser using DataLab