create_project_dirs <- function(type = c(1, 2), root = getwd()) {
if (type == 1) {
dirs <- c(
"data", "data/1-source", "data/2-aux", "data/3-final",
"output",
"scripts"
)
} else if (type == 2) {
dirs <- c(
"data", "data/1-source", "data/2-final",
"output",
"scripts"
)
} else {
stop("`type` must be 1 or 2")
}
dirs <- paste(root, dirs, sep = "/")
lapply(dirs, dir.create)
invisible(root)
}
