diff --git a/R/initProj.R b/R/initProj.R index 51c2317..b6cc192 100755 --- a/R/initProj.R +++ b/R/initProj.R @@ -149,7 +149,7 @@ initProj <- function(root_folder = ".", folders = NULL, init_git = NULL, init_renv = NULL, - code_subfolder = c("src", "src/functions", "src/config"), + code_subfolder = c("src", "src/functions", "src/configs"), global = FALSE, openproject = NULL, newsession = TRUE, standard_setup = "baseSpatial", @@ -226,7 +226,7 @@ initProj <- function(root_folder = ".", brew::brew(system.file(sprintf("templates/%s.brew", "pre-processing"), package = "link2GI"), file.path(dirs$src, "pre-processing.R")) brew::brew(system.file(sprintf("templates/%s.brew", "processing"), package = "link2GI"), file.path(dirs$src, "10-processing.R")) brew::brew(system.file(sprintf("templates/%s.brew", "post-processing"), package = "link2GI"), file.path(dirs$src, "post-processing.R")) - brew::brew(system.file(sprintf("templates/%s.brew", "config-master-yml"), package = "link2GI"), file.path(dirs$src, "config-master-yml")) + brew::brew(system.file(sprintf("templates/%s.brew", "config-master-yml"), package = "link2GI"), file.path(dirs$config, "config-master.yml")) brew::brew(system.file(sprintf("templates/%s.brew", standard_setup), package = "link2GI"),file.path(dirs$functions, "000_setup.R")) brew::brew(system.file(sprintf("templates/%s.brew", "yml"), package = "link2GI"),file.path(dirs$config, "pre-processing.yml")) brew::brew(system.file(sprintf("templates/%s.brew", "yml"), package = "link2GI"),file.path(dirs$config, "processing.yml")) diff --git a/inst/templates/advancedSpatial.brew b/inst/templates/advancedSpatial.brew index d2af921..6bc8787 100644 --- a/inst/templates/advancedSpatial.brew +++ b/inst/templates/advancedSpatial.brew @@ -27,53 +27,11 @@ if (!exists("root_folder")) { stop("variable root_folder is NOT defined, You must define a root folder!") } - -root_folder = envimaR::alternativeEnvi(root_folder = root_folder, - alt_env_id = alt_env_id, - alt_env_value = alt_env_value, - alt_env_root_folder = alt_env_root_folder) - -# mandantory folder structure -projectDirList = c("data/", # data folders the following are default but you may add more - "run/", # folder for runtime data as used by the API calls - paste0("data/",config_master$loc_name,"/data_lev0/"), # folder for level 0 data (raw or source data) - paste0("data/",config_master$loc_name,"/data_lev1/"), # folder for level 1 data (clean data) - paste0("data/",config_master$loc_name,"/data_lev2/"), # folder for level 2 data (final data) - paste0("data/",config_master$loc_name,"/auxdata/"), # folder for auxilliay data - "src/", # all scripts - "src/functions/", # all functions - "src/configs/", # all yaml configuration files - "tmp/", # all temp stuff - "doc/", # documentation and markdown - "doc/figures/") # documentation all figures etc - -# append additional folders if defined by calling script -if (exists("appendProjectDirList") && appendProjectDirList[[1]] != "") -{ - projectDirList = append(projectDirList,appendProjectDirList) -} - # call central function -envrmt = link2GI::setupProj(root_folder = root_folder, +dirs = link2GI::setupProj(root_folder = root_folder, folders = projectDirList, - fcts_folder = "src/functions/", - path_prefix = NULL, - libs = libs, - create_folders = TRUE) - - -ndvi.col = function(n) { - rev(colorspace::sequential_hcl(n, "Green-Yellow")) -} - -ano.col = colorspace::diverging_hcl(7, palette = "Red-Green", register = "rg") - - -## set temp path to speed up raster package operations -raster::rasterOptions(tmpdir = dirs$path_tmp) + fcts_folder = code_subfolders) # Define more variables # Load more data - - diff --git a/inst/templates/base.brew b/inst/templates/base.brew index d2af921..9240b15 100644 --- a/inst/templates/base.brew +++ b/inst/templates/base.brew @@ -28,52 +28,11 @@ if (!exists("root_folder")) { } -root_folder = envimaR::alternativeEnvi(root_folder = root_folder, - alt_env_id = alt_env_id, - alt_env_value = alt_env_value, - alt_env_root_folder = alt_env_root_folder) - -# mandantory folder structure -projectDirList = c("data/", # data folders the following are default but you may add more - "run/", # folder for runtime data as used by the API calls - paste0("data/",config_master$loc_name,"/data_lev0/"), # folder for level 0 data (raw or source data) - paste0("data/",config_master$loc_name,"/data_lev1/"), # folder for level 1 data (clean data) - paste0("data/",config_master$loc_name,"/data_lev2/"), # folder for level 2 data (final data) - paste0("data/",config_master$loc_name,"/auxdata/"), # folder for auxilliay data - "src/", # all scripts - "src/functions/", # all functions - "src/configs/", # all yaml configuration files - "tmp/", # all temp stuff - "doc/", # documentation and markdown - "doc/figures/") # documentation all figures etc - -# append additional folders if defined by calling script -if (exists("appendProjectDirList") && appendProjectDirList[[1]] != "") -{ - projectDirList = append(projectDirList,appendProjectDirList) -} - # call central function -envrmt = link2GI::setupProj(root_folder = root_folder, +dirs = link2GI::setupProj(root_folder = root_folder, folders = projectDirList, - fcts_folder = "src/functions/", - path_prefix = NULL, - libs = libs, - create_folders = TRUE) - - -ndvi.col = function(n) { - rev(colorspace::sequential_hcl(n, "Green-Yellow")) -} - -ano.col = colorspace::diverging_hcl(7, palette = "Red-Green", register = "rg") - - -## set temp path to speed up raster package operations -raster::rasterOptions(tmpdir = dirs$path_tmp) + fcts_folder = code_subfolders) # Define more variables # Load more data - - diff --git a/inst/templates/config-default-projects.yml b/inst/templates/config-default-projects.yml index 5f13e66..c7e8621 100644 --- a/inst/templates/config-default-projects.yml +++ b/inst/templates/config-default-projects.yml @@ -4,7 +4,7 @@ base: tmpFolder: ["tmp"] init_git: true init_renv: true - code_subfolder: ["src", "src/functions" , "src/config"] + code_subfolder: ["src", "src/functions" , "src/configs"] global: false libs: "" create_folders: true @@ -13,7 +13,7 @@ baseSpatial: dataFolder: ["level0", "level1", "level2", "run" ,"aux"] docsFolder: [ "figures"] tmpFolder: ["tmp"] - code_subfolder: ["src", "src/functions" , "src/config"] + code_subfolder: ["src", "src/functions" , "src/configs"] init_git: true init_renv: true global: false @@ -24,7 +24,7 @@ advancedSpatial: dataFolder: ["level0", "level1", "level2", "run"] docsFolder: [ "figures"] tmpFolder: ["tmp"] - code_subfolder: ["src", "src/functions" , "src/config"] + code_subfolder: ["src", "src/functions" , "src/configs"] init_git: true init_renv: true global: false diff --git a/inst/templates/readme.brew b/inst/templates/readme.brew index eafc371..2013a79 100644 --- a/inst/templates/readme.brew +++ b/inst/templates/readme.brew @@ -9,4 +9,4 @@ In order to have the standard packages and the project structure available, the It automatically sources the file `000_setup.R`, which contains the basic settings for the selected setup type. -These can of course be extended manually and adapted to the respective requirements. The paths to the directories are stored in the `envrmt` list +These can of course be extended manually and adapted to the respective requirements. The paths to the directories are stored in the dir` list diff --git a/man/initProj.Rd b/man/initProj.Rd index 8d3a236..e94c63d 100644 --- a/man/initProj.Rd +++ b/man/initProj.Rd @@ -9,7 +9,7 @@ initProj( folders = NULL, init_git = NULL, init_renv = NULL, - code_subfolder = c("src", "src/functions", "src/config"), + code_subfolder = c("src", "src/functions", "src/configs"), global = FALSE, openproject = NULL, newsession = TRUE,