rappdirs-package: Application directories: determine where to save data, caches...

Description main functions single entry function Caveats See Also Examples

Description

rappdirs solves the problem of where to save persistent data outside of the R library or the R per-session tempdir.

main functions

single entry function

The app_dir provides a convenient single entry point.

Caveats

Note that if you use rappdir's user_data_dir and friends to define a storage location for files you must be aware of race conditions when more than one R process tries to create/write files in this directory. This is in contrast to using the tempdir, tempfile base functions which should be unique for each R process. In general the directories provided by rappdirs are most suitable for storing data that is rarely written but might need to be shared across R sessions.

Note also that the CRAN Policies have the following to say about storage of data by packages:

- Packages should not write in the users' home filespace, nor anywhere else on the file system apart from the R session's temporary directory (or during installation in the location pointed to by TMPDIR: and such usage should be cleaned up). Installing into the system's R installation (e.g., scripts to its bin directory) is not allowed.

Limited exceptions may be allowed in interactive sessions if the package obtains confirmation from the user.

See Also

app_dir, user_data_dir, user_config_dir, user_cache_dir, site_data_dir, user_log_dir

Examples

1
2
dirs <- app_dir("SuperApp", "Acme")
dirs$config()

rappdirs documentation built on May 2, 2019, 8:57 a.m.