These functions create the plot history directory and invisibly return the path:

  • phist_tmp_dir() creates a ' temporary directory.

  • phist_cache_dir() uses the package's central ' cache directory.

  • phist_dir() takes a user-defined ' directory.

The directory creating is delegated to tempdir() by phist_tmp_dir() and dir.create() by phist_dir() and phist_cache_dir().

phist_dir(path, ...)

phist_tmp_dir()

phist_cache_dir(ask = TRUE)

Arguments

path

character(1) with a single path name, passed to dir.create(). Only relevant in the user-defined case.

...

Additional parameters passed to dir.create().

ask

logical(1) that defines whether to ask to create the cache directory if it doesn't exist yet. Default is TRUE.

Value

Used for its side effect of creating a directory. Invisibly returns the path to the newly created directory.

Examples


## temp directory
phist_tmp_dir()
#> Plot history set to
#>   /tmp/Rtmpt1DKh3

## central cache
phist_cache_dir()
#> Plot history set to
#>   /home/runner/.cache/R/plothistory

## user-defined directory
phist_dir(getwd())
#> Plot history set to
#>   /home/runner/work/plothistory/plothistory/docs/reference