Skip to contents

This utility function creates a directory (and any necessary parent directories) if it doesn't already exist. It's used throughout the hotrstuff package to ensure output directories are available before processing.

Usage

htr_make_folder(folder)

Arguments

folder

Character string. Path to the directory to be created. Can be relative or absolute path. Parent directories will be created recursively if they don't exist.

Value

No return value. The function creates the directory structure as needed.

Note

  • Uses dir.create() with recursive = TRUE to create parent directories

  • Checks if directory already exists before attempting creation

  • No error is thrown if directory already exists

Examples

if (FALSE) { # \dontrun{
htr_make_folder("~/Data/output")
htr_make_folder("./results/processed/regridded")
} # }