locdir: local data directory

View source: R/locdir.R

locdirR Documentation

local data directory

Description

Get the 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").
You could add this to your .Rprofile file e.g. via usethis::edit_r_profile()

Usage

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

Arguments

dir

Path to data directory. If dir is NULL, locdir tries "C:/DWDdata", then "~/DWDdata", then tools::R_user_dir⁠("rdwd", which="cache")⁠.

dir can also be set with options(rdwdlocdir="YOUR/PATH") thanks to the DEFAULT: base::getOption("rdwdlocdir")

file

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

quiet

Ignored since version 1.9.4 (2025-10-20). DEFAULT: FALSE through rdwdquiet()

Value

charstring (directory)

Author(s)

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

See Also

dataDWD(), runLocalTests()

Examples

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


rdwd documentation built on July 3, 2026, 9:07 a.m.