-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert conception to roel.R
48 lines (35 loc) · 1.35 KB
/
convert conception to roel.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
41
42
43
44
45
46
47
48
library(readr)
library(readxl)
library(magrittr)
library(dplyr)
library(tidyr)
library(stringr)
conception_to_roel <- function(file) {
test1 <- file
test2 <- test1 %>% select(dataset_name, step_producing_this_dataset, folder_where_the_datset_is_stored) %>%
mutate(TYPE = "OUTPUT") %>%
unique()
test3 <- test1 %>% select(step_producing_this_dataset, folder_where_the_datset_is_stored,
dataset_name = input_datasets_for_the_step) %>%
drop_na(dataset_name) %>%
mutate(TYPE = "INPUT") %>%
unique() %>%
separate_rows(dataset_name, sep = " ", convert = FALSE)
test23 <- rbind(test2, test3)
test23 <- test23 %>%
mutate(folder_where_the_datset_is_stored = "a") %>%
rename(PROGRAM = "step_producing_this_dataset") %>%
rename(FOLDER_VAR = "folder_where_the_datset_is_stored") %>%
rename(FILE = "dataset_name") %>%
select(PROGRAM, FOLDER_VAR, FILE, TYPE)
return(test23)
}
data.table::fwrite(test23, "index.csv")
source("create diagram.R")
source("helper_functions.R")
source("styles_and_parameters.R")
steps_style <- c(cell_style = "circle")
datamodels_style <- c(cell_style = "yellow")
arrows_style <- c(arrow_style = "circle arrow")
test_xml <- create_diagram("index.csv", pages = 1, arrows_style, steps_style, datamodels_style, direction = "TB")
xml2::write_xml(test_xml, "test CovE.xml")