-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdata-management.R
37 lines (22 loc) · 992 Bytes
/
data-management.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
#Updating files w/ dictionary data dependencies
#Loading path - untracked file w/ personal WD
source(here::here("path.R")) # Local copy of your directory path
source(here::here("MAPS_Dictionary-Protocol.R"))
#Saving dictionary
for(i in 1:length(path)) {
saveRDS(dictionary.df, file = paste0(path[i], "/data/dictionary.df.rds"))
}
#lapply(dictionary.df, file = paste0(path, "/data/dictionary.df.rds"), saveRDS)
# Run source()
#fct <- c("ke18_dict.R", "wa19_dict.R", "uk21_dict.R", "us19_dict.R", "ja15_dict.R")
#source(here::here("FCTs", fct[1]))
fcts <- list.files(here::here("FCTs") , "*_dict.R")
source(here::here("FCTs", fcts[2]))
eval(parse(text = paste0("source('FCTs/", fcts, "')")))
#Saving dictionary-to-FCTs-matches
file <- sort(list.files(here::here("metadata") , "dict_fct_compilation_v\\."),
decreasing = T)[1]
for(i in 1:length(path)) {
write.csv(read.csv(here::here("metadata", file)),
paste0(path[i], "/data/",file), row.names = F)
}