path() constructs a relative path, path_wd() constructs an absolute path
from the current working directory.
Usage
cache_path(..., cache_dir = rappdirs::user_cache_dir("dchunkr"))Arguments
- ...
character vectors, if any values are NA, the result will also be NA. The paths follow the recycling rules used in the tibble package, namely that only length 1 arguments are recycled.
- cache_dir
Character. A directory for the cache.
See also
path_home(), path_package() for functions to construct paths
relative to the home and package directories respectively.
Examples
dir <- withr::local_tempfile()
fs::dir_exists(dir)
#> /tmp/RtmpgmEn6Z/file18af584dcd97
#> FALSE
cache_path("b", cache_dir = dir)
#> /tmp/RtmpgmEn6Z/file18af584dcd97/b
fs::dir_exists(dir)
#> /tmp/RtmpgmEn6Z/file18af584dcd97
#> TRUE