Various functions for direct directory manipulation (e.g. avoid use of system(<…command…>))
dir.create() to create the last element of the path, unless recursive = TRUE.
dir.exists() to check existence of directory(ies)
See ?dir.create for more information
list.dirs(path = ".", full.names = TRUE, recursive = TRUE)
dir.exists(paths)
dir.create(path, showWarnings = TRUE, recursive = FALSE, mode = "0777")