osfr (version 0.2.4)

osf_mkdir: Create directories on OSF

Description

Use osf_mkdir() to create a new directory on OSF. Directories can be added to projects, components, or nested within existing directories on OSF. If path contains multiple directories (e.g., "data/rawdata") the intermediate-level directories will be created if needed.

Usage

osf_mkdir(x, path, verbose = FALSE)

Arguments

x

One of the following:

path

Name of the new directory or a path ending with the new directory.

verbose

Logical, indicating whether to print informative messages about interactions with the OSF API (default FALSE).

Value

An osf_tbl_file with one row containing the leaf directory specified in path.

Examples

Run this code
# NOT RUN {
proj <- osf_create_project("Directory Example")

# add directory to the top-level of the Directory Example project
data_dir <- osf_mkdir(proj, path = "data")

# add a subdirectory nested within data/
osf_mkdir(data_dir, path = "rawdata")

# recursively create multiple directory levels within data/
osf_mkdir(data_dir, path = "samples/pcr/qc")
# }

Run the code above in your browser using DataCamp Workspace