forked from danief/VKM_data_management_plan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVKM_recommended_folder_structure.R
40 lines (32 loc) · 1.75 KB
/
VKM_recommended_folder_structure.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
vkm_data <- function(input = "vkm_data", is.SLR = FALSE, search.num = 1) {
newdir <- paste0(getwd(), "/", input, format(Sys.Date(), "_%Y.%m.%d"))
# Check if directory already exists
if (!file.exists(newdir)) {
dir.create(newdir)
# Create subdirectories
dir.create(paste0(getwd(), "/Data"), showWarnings = FALSE)
dir.create(paste0(getwd(), "/Literature_Data"), showWarnings = FALSE)
for (s in 1:search.num) {
dir.create(paste0(getwd(), "/Literature_Data/search_", s), showWarnings = FALSE)
dir.create(paste0(getwd(), "/Literature_Data/search_", s, "/1_search_query"), showWarnings = FALSE)
dir.create(paste0(getwd(), "/Literature_Data/search_", s, "/2_study_selection"), showWarnings = FALSE)
dir.create(paste0(getwd(), "/Literature_Data/search_", s, "/3_full_text"), showWarnings = FALSE)
dir.create(paste0(getwd(), "/Literature_Data/search_", s, "/4_data_extraction"), showWarnings = FALSE)
if (is.SLR) {
dir.create(paste0(getwd(), "/Literature_Data/search_", s, "/5_internal_validity"), showWarnings = FALSE)
dir.create(paste0(getwd(), "/Literature_Data/search_", s, "/6_confidence_in_evidence"), showWarnings = FALSE)
}
}
dir.create(paste0(getwd(), "/Data/1_raw_data"), showWarnings = FALSE)
dir.create(paste0(getwd(), "/Data/2_processed_data"), showWarnings = FALSE)
dir.create(paste0(getwd(), "/Data/3_metadata"), showWarnings = FALSE)
dir.create(paste0(getwd(), "/Data/4_scripts"), showWarnings = FALSE)
dir.create(paste0(getwd(), "/Data/5_outputs"), showWarnings = FALSE)
} else {
print("Folder already exists.")
}
}
# kjør funksjon uten SLR
vkm_data("navn_paa_prosjekt")
# SLR eksempel med fire søk
vkm_data("SLR_prosjekt", is.SLR=TRUE, 4)