Skip to contents

Set the caching directory to store data retrieved using the rhud API calls. By default, rhud uses a non-persistent temporary directory given for an R session. However, it is possible that a user might want to save their queried data in a custom location which is persistent. This function allows users to set the cache directory. The user can also store the preferred path in the .RProfile so that rhud will remember the set preference directory throughout sessions. Make sure the path is valid and and is not in a sensitive location.

Windows users: please note that you'll need to use double-backslashes or forward slashes when specifying your cache directory's path in R.

  • This will create a folder called rhud_cache in specified path

  • If setting a new directory, the previous cache will not be cleaned. In a future update there will be a garbage collection option.

Usage

hud_set_cache_dir(path, in_wkdir = FALSE, in_home = FALSE)

Arguments

path

A character vector of length one specifying the full path to the desired cache directory. Only one can be set at a time. If no path is specified, it will use the temp directory for R. The temp directory is not persistent.

in_wkdir

A logical to determine if to store the path as environment variable in the working directory .Rprofile so rhud will cache to this specified path.

in_home

A logical to determine if to store the path as environment variable in the HOME directory .Rprofile so rhud will cache to this specified path.

See also

Examples

if (FALSE) {

hud_set_cache_dir("./an/example/path", in_wkdir = TRUE, in_home = TRUE)

}