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

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).

Value

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

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.

See also

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

Examples

if (FALSE) {
fileman_folders()
datapath <- fileman_folders(root = "git")
}