mkdir: Creates new directory in which to write files

View source: R/mkdir.R

mkdirR Documentation

Creates new directory in which to write files

Description

Given a base directory and string, will check if specified directory exits, and make it if not. Can also choose to set as working directory.

Usage

mkdir(baseDir_v = NULL, newDir_v, wd_v = F, recursive_v = T)

Arguments

baseDir_v

Character string. Relative or absolute path to directory that will be parent of newly created directory. If set to NULL (default), then will use working directory.

newDir_v

Character string. Name of new directory.

wd_v

boolean values determining if new directory should be set as working directory (T) or not (F).

recursive_v

boolean value determining if all elements of path other than last should be created. Passed to dir.create

Value

Character string of path to new directory. Makes directory in file system. If wd_v == TRUE, also sets as working directory.

Examples

mkdir("~/", "mkdir_test")
setwd("~/test/")
mkdir(newDir_v = "anotherTest")
mkdir("~/", "wdTest", wd_v = T)
myDir_v <- mkdir("~/", "finalTest")

weshorton/wrh.rUtils documentation built on Oct. 28, 2024, 7:24 a.m.