dirMaker {BeeBDC} | R Documentation |
Set up global directory paths and create folders
Description
This function sets up a directory for saving outputs (i.e. data, figures) generated through the use of the BeeBDC package, if the required folders do not already exist.
Usage
dirMaker(
RootPath = RootPath,
ScriptPath = NULL,
DataPath = NULL,
DataSubPath = "/Data_acquisition_workflow",
DiscLifePath = NULL,
OutPath = NULL,
OutPathName = "Output",
Report = TRUE,
Check = TRUE,
Figures = TRUE,
Intermediate = TRUE,
RDoc = NULL,
useHere = TRUE
)
Arguments
RootPath |
A character String. The |
ScriptPath |
A character String. The |
DataPath |
A character string. The path to the folder containing bee occurrence data to be flagged and/or cleaned |
DataSubPath |
A character String. If a |
DiscLifePath |
A character String. The path to the folder which contains data from Ascher and Pcikering's Discover Life website. |
OutPath |
A character String. The path to the folder where output data will be saved. |
OutPathName |
A character String. The name of the |
Report |
Logical. If TRUE, function creates a "Report" folder within the OutPath-defined folder. Default = TRUE. |
Check |
Logical. If TRUE, function creates a "Check" folder within the OutPath-defined folder. Default = TRUE. |
Figures |
Logical. If TRUE, function creates a "Figures" folder within the OutPath-defined folder. Default = TRUE. |
Intermediate |
Logical. If TRUE, function creates a "Intermediate" folder within the OutPath-defined folder in which to save intermediate datasets. Default = TRUE. |
RDoc |
A character String. The path to the current script or report, relative to the project
root. Passing an absolute path raises an error. This argument is used by |
useHere |
Logical. If TRUE, dirMaker will use |
Value
Results in the generation of a list containing the BeeBDC-required directories in your global environment. This function should be run at the start of each session. Additionally, this function will create the BeeBDC-required folders if they do not already exist in the supplied directory
Examples
# load dplyr
library(dplyr)
# Standard/basic usage:
RootPath <- tempdir()
dirMaker(
RootPath = RootPath,
# Input the location of the workflow script RELATIVE to the RootPath
RDoc = NULL,
useHere = FALSE) %>%
# Add paths created by this function to the environment()
list2env(envir = environment())
# Custom OutPathName provided
dirMaker(
RootPath = RootPath,
# Set some custom OutPath info
OutPath = NULL,
OutPathName = "T2T_Output",
# Input the location of the workflow script RELATIVE to the RootPath
RDoc = NULL,
useHere = FALSE) %>%
# Add paths created by this function to the environment()
list2env(envir = environment())
# Set the working directory
# Further customisations are also possible
dirMaker(
RootPath = RootPath,
ScriptPath = "...path/Bee_SDM_paper/BDC_repo/BeeBDC/R",
DiscLifePath = "...path/BDC_repo/DiscoverLife_Data",
OutPathName = "AsianPerspective_Output",
# Input the location of the workflow script RELATIVE to the RootPath
RDoc = NULL,
useHere = FALSE) %>%
# Add paths created by this function to the environment()
list2env(envir = environment())