fileman_folders: Create a standard data folder structure and return the path...

View source: R/filemanagement.R

fileman_foldersR Documentation

Create a standard data folder structure and return the path to the n2khab_data folder

Description

This function will check for the existence of default data folders, create them if necessary, and return the path to the n2khab_data folder.

Usage

fileman_folders(root = c("rproj", "git"), path = NA)

Arguments

root

Character string indicating whether the root folder of the current git repository or the root folder of the current Rstudio project should be used as the folder where you want the data folder structure to be created. Can be "rproj" (the default) for an RStudio R project or "git" for a git repository.

path

An optional argument to specify a custom path to a folder where you want the data folder structure to be created. Default is NA (no custom path).

Details

In n2khab projects a standardized folder setup is used for binary data, as explained in the vignette on data storage (run vignette("v020_datastorage")). The functions creates the folders n2khab_data, n2khab_data/10_raw and n2khab_data/20_processed, or prints a message if these already exist. The function returns the path to n2khab_data.

Value

A character string that gives the absolute path to the n2khab_data/ folder.

See Also

Other functions regarding file management for N2KHAB projects: checksum(), download_zenodo(), fileman_up(), locate_n2khab_data()

Examples

## Not run: 
fileman_folders()
datapath <- fileman_folders(root = "git")

## End(Not run)


inbo/n2khab documentation built on Jan. 15, 2025, 9:36 a.m.