-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample_single_data.R
More file actions
44 lines (37 loc) · 1.01 KB
/
example_single_data.R
File metadata and controls
44 lines (37 loc) · 1.01 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
# simple example for one file with eilers and peeters model
install.packages("pam")
library("pam")
library("ggplot2")
script_dir <- file.path(getwd(), "examples")
data_path <- file.path(script_dir, "data", "20231122_01.csv")
output_dir <- file.path(script_dir, "output")
dir.create(output_dir, showWarnings = FALSE)
# reading raw data csv
data <- read_dual_pam_data(data_path)
# generating model result
model_result <- eilers_peeters_generate_regression_ETR_II(data)
# modifying model result
model_result_modified <- eilers_peeters_modified(model_result)
# generating plot
plot <- plot_control(
data,
model_result_modified,
"plot_control_eilers_peeters_ETR_II_modifed_20231122_01.jpg",
color = "blue"
)
print(plot)
# exporting plot
ggsave(
"20231122_01.jpg",
plot = plot,
path = output_dir,
width = 10,
height = 10
)
# exporting intermediate table and model result data
write_model_result_csv(
output_dir,
"20231122_01.csv",
data,
model_result_modified
)