Learn R Programming

pkgmaker (version 0.32.10)

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()))

Value

Path to the user data directory.

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