Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

userData

User Data Directory userData returns the path to a local directory/file where package-related user data can be stored. Note that a base directory is always created if necessary (see details).


Description

The package-specific user data base directory is the sub-directory R-data/, located in the user's home or within a diredctory defined by global option 'userData.path'.

If in interactive mode, and the base directory does not exist yet, the user is asked if it should be created in his home directory. Otherwise, or if the user does not allow the creation in his home, this directory is created in the current R session's temporary directory.

Usage

userData(..., create = NULL, package = topenv(parent.frame()))

Arguments

...

path parts passed to file.path to be appended to the main path.

create

logical that indicates if the base directory should be created if it does not exists.

Note that directories – and files – under the base directory are not automatically created. The user should therefore care of it in the caller function if necessary.

If create=TRUE, then the base directory is forced to be created in the user's home directory. If create=FALSE, then the base directory is never created.

See also section Details.

package

name of the package associated with the user data path. It is used to prefix the path, within the user R data directory.

See Also


pkgmaker

Development Utilities for R Packages

v0.32.2
GPL (>= 2)
Authors
Renaud Gaujoux [aut, cre]
Initial release
2020-10-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.