Skip to content

Commit 91f0fad

Browse files
committed
Feat: adding setup_rproj utility
1 parent 546bae5 commit 91f0fad

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export(get_sp_stats)
1313
export(get_sp_summary)
1414
export(pieplot)
1515
export(representative)
16+
export(setup_rproj)
1617
export(superplot)
1718
import(cowplot)
1819
import(dplyr)

R/setup_rproj.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#' Ensure working directory setup
2+
#'
3+
#' Checks if the directories ("Data", "Output", "Output/Data",
4+
#' "Output/Plots", "Script") exist in the current working directory. If any of
5+
#' these directories are missing, it creates them to ensure that the project
6+
#' structure is properly set up.
7+
#'
8+
#' @returns No return value
9+
#' @export
10+
#'
11+
setup_rproj <- function() {
12+
cat("Ensuring project directory structure...\n")
13+
if (!dir.exists("Data")) dir.create("Data")
14+
if (!dir.exists("Output")) dir.create("Output")
15+
if (!dir.exists("Output/Data")) dir.create("Output/Data")
16+
if (!dir.exists("Output/Plots")) dir.create("Output/Plots")
17+
if (!dir.exists("Script")) dir.create("Script")
18+
}

man/setup_rproj.Rd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)