initialize_project {org} | R Documentation |
Initializes project
Description
org::initialize_project
takes in 2+ arguments.
It then saves folder locations in the return value (a new environment) and
in org::project
, which you will use in all of your subsequent code. An additional
folder will be created on the user's file system (org::project$results_today) which
corresponds to results/YYYY-MM-DD
. The sourced folders are saved into org::project$env.
Usage
initialize_project(
env = new.env(),
home = NULL,
results = NULL,
folders_to_be_sourced = "R",
source_folders_absolute = FALSE,
encode_from = "UTF-8",
encode_to = "latin1",
...
)
Arguments
env |
The environment that the code will be sourced into (use |
home |
The folder containing 'Run.R' and 'R/' |
results |
A folder inside |
folders_to_be_sourced |
The names of folders that live inside |
source_folders_absolute |
If |
encode_from |
Folders current encoding (only used on Windows) |
encode_to |
Folders final encoding (only used on Windows) |
... |
Other folders that you would like to reference |
Details
For more details see the help vignette:
vignette("intro", package = "org")
Value
Returns an environment that contains:
Folder locations
An environment called
env
into which the code has been sourced into. There is also a side effect whereorg::project
mirrors these values.
Examples
org::initialize_project(
home = paste0(tempdir(), "/git/analyses/2019/analysis3/"),
results = paste0(tempdir(), "/dropbox/analyses_results/2019/analysis3/"),
raw = paste0(tempdir(), "/data/analyses/2019/analysis3/")
)
org::project$results_today
org::project$raw