create_project_structure: Create a Standardized Project Folder Structure

View source: R/setup.R

create_project_structureR Documentation

Create a Standardized Project Folder Structure

Description

This function creates a standardized folder structure for organizing data, scripts, and outputs within a project directory. It ensures consistency and reproducibility for data-related workflows.

Usage

create_project_structure(base_path = here::here())

Arguments

base_path

A character string specifying the root directory where the folder structure will be created. Defaults to 'here::here()' to use the current project directory.

Details

The function generates the following folder structure:

# 01_data/
# +-- 1a_survey_data/
# |    +-- processed/
# |    \-- raw/
# +-- 1b_rasters/
# |    +-- urban_extent/
# |    \-- pop_raster/
# +-- 1c_shapefiles/
# 02_scripts/
# 03_outputs/
# +-- 3a_model_outputs/
# +-- 3b_visualizations/
# +-- 3c_table_outputs/
# \-- 3d_compiled_results/

Value

Creates directories under the specified 'base_path'. Returns invisible 'NULL' and prints messages about folder creation status.

Examples


# Create temp directory with normalized path
tf <- file.path(tempdir(), "test_env")
dir.create(tf, recursive = TRUE, showWarnings = FALSE)

#  Initialize with normalized path
cpp_path <- file.path(tf, "02_scripts", "model")
dir.create(cpp_path, recursive = TRUE, showWarnings = FALSE)
cpp_path <- normalizePath(cpp_path, winslash = "/", mustWork = FALSE)

create_project_structure(base_path = tf)


AgePopDenom documentation built on April 12, 2025, 1:41 a.m.