create_dir: Create a directory including full path outside of the working...

Description Usage Arguments Details Examples

View source: R/create_dir.R

Description

This function checks whether a directory in a given path exists and creates it - including any missing directories in the path - if that is not the case.

Usage

1
create_dir(dir, fullPath = F)

Arguments

dir

A character string defining the path to the directory that should be created

fullPath

A boolean flag indicating whether the directory string provided is a full path or not. If FALSE, dir is created in the user's home directory as defined by Sys.getenv("HOME").

Details

This function is generally useful in the setup process of any (part of a) project where the existence of a specific directory is dependent on the first execution of a related part of your code base.

Examples

1
2
3
4
5
6
create_dir('my/export/directory')

create_dir('~/my/export/directory', TRUE)

# using the get_file_path() function in jaytools
create_dir(get_file_path('my/export/directory'), TRUE)

matt-jay/rjaytools documentation built on May 28, 2019, 8:45 a.m.