Use osf_mkdir()
to add new directories to projects, components, or nested
within existing OSF directories. If path
contains multiple directory
levels (e.g., "data/rawdata"
) the intermediate-level directories are
created automatically. If the directory you're attempting to create already
exists on OSF it will be silently ignored and included in the output.
Arguments
- x
One of the following:
An
osf_tbl_node
with a single OSF project or component.An
osf_tbl_file
containing a single directory.
- 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
if (FALSE) { # \dontrun{
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")
} # }