createEnvi: Setup project folder structure

Description Usage Arguments Value See Also Examples

View source: R/createEnvi.R

Description

Defines folder structures and creates them if necessary, loads libraries, and sets other project relevant parameters.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
createEnvi(
  root_folder = tempdir(),
  folders = c("data", "data/tmp"),
  folder_names = NULL,
  path_prefix = NULL,
  code_subfolders = NULL,
  dvc_subfolders = NULL,
  global = FALSE,
  libs = NULL,
  setup_script = "000_setup.R",
  fcts_folder = NULL,
  source_functions = !is.null(fcts_folder),
  alt_env_id = NULL,
  alt_env_value = NULL,
  alt_env_root_folder = NULL,
  standard_setup = NULL,
  lut_mode = NULL,
  create_folders = TRUE,
  git_repository = NULL,
  git_subfolders = NULL
)

Arguments

root_folder

root directory of the project.

folders

list of subfolders within the project directory.

folder_names

names of the variables that point to subfolders. If not provided, the base paths of the folders is used.

path_prefix

a prefix for the folder names.

code_subfolders

define subdirectories for code should be created.

dvc_subfolders

subfolders for data that should be added to dvc.

global

logical: export path strings as global variables?

libs

vector with the names of libraries

setup_script

name of the setup script. This file will not be sourced from the functions folder even if fcts_folder is provided.

fcts_folder

path of the folder holding the functions. All files in this folder will be sourced.

source_functions

logical: should functions be sourced?

alt_env_id

alternative system environment attribute used to check for setting an alternative root_folder.

alt_env_value

value of the attribute for which the alternative root directory of the project should be set.

alt_env_root_folder

alternative root directory.

standard_setup

use predefined settings. In this case, only the name of the root folder is required. See names(envimaR::lutInfo()) for available standards. name of the git repository must be supplied to the function.

lut_mode

deprecated, use standard_setup instead.

create_folders

create folders if not existing already.

git_repository

deprecated, use code_subfolders instead.

git_subfolders

deprecated, use code_subfolders instead.

Value

A list containing the project settings.

See Also

alternativeEnvi()

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
createEnvi(
  root_folder = "~/edu", folders = c("data/", "data/tmp/"),
  libs = c("link2GI"),
  alt_env_id = "COMPUTERNAME", alt_env_value = "PCRZP",
  alt_env_root_folder = "D:\\BEN\\edu"
)

## End(Not run)

envima/envimaR documentation built on July 18, 2021, 1:40 p.m.