-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample_combo_plot_control.R
More file actions
48 lines (43 loc) · 1.4 KB
/
Copy pathexample_combo_plot_control.R
File metadata and controls
48 lines (43 loc) · 1.4 KB
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
# example for combo plot control
install.packages("pam")
library("pam")
library("ggplot2")
script_dir <- file.path(getwd(), "examples")
data_path <- file.path(script_dir, "data", "20231122_01.csv")
data <- read_dual_pam_data(data_path)
output_dir <- file.path(script_dir, "output")
dir.create(output_dir, showWarnings = FALSE)
# generating regression data
eilers_peeters <- eilers_peeters_generate_regression_ETR_II(data)
platt <- platt_generate_regression_ETR_II(data)
vollenweider <- vollenweider_generate_regression_ETR_II(data)
walsby <- walsby_generate_regression_ETR_II(data)
# modifying model results
eilers_peeters_modified <- eilers_peeters_modified(eilers_peeters)
platt_modified <- platt_modified(platt)
vollenweider_modified <- vollenweider_modified(vollenweider)
walsby_modified <- walsby_modified(walsby)
# creating combo control plot
model_results <- list(
eilers_peeters_modified,
platt_modified,
vollenweider_modified,
walsby_modified
)
name_list <- list("Eilers & Peeters", "Platt", "Vollenweider", "Walsby")
color_list <- list("blue", "red", "green", "orange")
combo_plot_control <- combo_plot_control(
"combo_plot_control_20231122_01.csv",
data,
model_results,
name_list,
color_list
)
print(combo_plot_control)
ggsave(
"combo_plot_control_20231122_01.jpg",
plot = combo_plot_control,
width = 10,
height = 22,
path = output_dir
)