rappdirs solves the problem of where to save persistent data
outside of the R library or the R per-session
user data dir (
user config dir (
user cache dir (
site data dir (
user log dir (
app_dir provides a convenient single entry point.
Note that if you use rappdir's
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
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.
dirs <- app_dir("SuperApp", "Acme") dirs$config()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.