Learn R Programming

librarian (version 1.8.1)

make_dirs: Build a path, creating subfolders if needed

Description

Whereas base::file.path() only concatenates strings to build a path, make_dirs() also makes sure those folders exist.

Usage

make_dirs(...)

Arguments

...

(Character) Arguments to send to file.path(). You can provide a complete path as a single string, or incrementally build a path with many strings.

Value

(Character) A file path. Automatically adds trailing slashes if required.

Authors

Examples

Run this code
# NOT RUN {
make_dirs(tempdir(), "newfolder")

#> [1] "C:/Users/.../Temp/RtmpSwZA8X/newfolder"
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab