content_dir: content store home directory

Description Usage Arguments Details Examples

View source: R/content_dir.R

Description

A configurable default location for persistent data storage

Usage

1
content_dir(dir = Sys.getenv("CONTENTID_HOME", tools::R_user_dir("contentid")))

Arguments

dir

directory to be used as the home directory

Details

This function is intended to be called internally with no arguments. It will use the directory set by the system environmental variable CONTENTID_HOME, if set. Otherwise, it will use the default location returned by tools::R_user_dir for the application, contentid. Unlike rappdirs function, this function will also create the directory if it does not yet exist.

Examples

1
2
3
4
5
6
7
8
9
## example using temporary storage: 
Sys.setenv(CONTENTID_HOME=tempdir())
content_dir()

## clean up
Sys.unsetenv("CONTENTID_HOME")

## Or explicitly with an argument:
content_dir(tempdir())

cboettig/contentid documentation built on April 1, 2021, 11:25 p.m.