Skip to content

Commit ee70f70

Browse files
committedFeb 18, 2025·
Merge branch 'bad-weather-TBS' of https://github.com/matsim-scenarios/matsim-kelheim into bad-weather-TBS
2 parents c3fac2a + 51a2d78 commit ee70f70

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed
 

‎src/main/R/badWeather/regressionAnalysis.R

+12-13
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ result_data <- result_data %>%
148148
left_join(df_schoolHolidays, by = "date") %>%
149149
replace_na(list(isHoliday = FALSE,snow = 0, isSchoolHoliday = FALSE)) %>%
150150
#%>% filter(noRides != 0)
151-
filter(date <= as.Date("2022-12-31"))
151+
filter(date <= as.Date("2022-12-31"))
152152

153153
sundays <- result_data %>%
154154
filter(wday == 7)
@@ -312,7 +312,7 @@ noRides_time <- ggplot(result_data) +
312312
y = mean(range(result_data$noRides)),
313313
label = "Change of operator,\nperiod removed",
314314
color = "black",
315-
size = 11,
315+
size = 9,
316316
angle = 90) +
317317
# geom_point(data = result_data %>% filter(wday_char == "Mon"), mapping = aes(x = date, y = noRides, color = "Mon"), size = 3) +
318318
# geom_point(data = result_data %>% filter(wday_char == "Tue"), mapping = aes(x = date, y = noRides, color = "Tue"), size = 3) +
@@ -381,7 +381,7 @@ tavg_time <- ggplot(result_data) +
381381
y = mean(range(result_data$tavg)),
382382
label = "Change of operator,\nperiod removed",
383383
color = "black",
384-
size = 11,
384+
size = 9,
385385
angle = 90) +
386386
#geom_vline(xintercept = as.numeric(year_breaks), color = "red", linetype = "dashed", size = 1) +
387387
#geom_text(data = data.frame(x = year_breaks, y = rep(min(result_data$noRides), length(year_breaks)), year = substr(year_breaks, 3, 4)),
@@ -436,7 +436,7 @@ stringency_time <- ggplot(result_data) +
436436
y = mean(range(result_data$stringency)),
437437
label = "Change of operator,\nperiod removed",
438438
color = "black",
439-
size = 11,
439+
size = 9,
440440
angle = 90) +
441441
#geom_vline(xintercept = as.numeric(year_breaks), color = "red", linetype = "dashed", size = 1) +
442442
#geom_text(data = data.frame(x = year_breaks, y = rep(min(result_data$noRides), length(year_breaks)), year = substr(year_breaks, 3, 4)),
@@ -457,10 +457,10 @@ snow_time <- ggplot(result_data) +
457457
ymin = -Inf, ymax = Inf, fill = "#D55E00", alpha=.3) +
458458
annotate("text",
459459
x = as.Date("2021-05-31"),
460-
y = mean(range(result_data$snow)),
460+
y = 55,
461461
label = "Change of operator,\nperiod removed",
462462
color = "black",
463-
size = 11,
463+
size = 9,
464464
angle = 90) +
465465
#geom_vline(xintercept = as.numeric(year_breaks), color = "red", linetype = "dashed", size = 1) +
466466
#geom_text(data = data.frame(x = year_breaks, y = rep(min(result_data$noRides), length(year_breaks)), year = substr(year_breaks, 3, 4)),
@@ -485,7 +485,7 @@ wdir_time <- ggplot(result_data) +
485485
y = mean(range(result_data$wdir)),
486486
label = "Change of operator,\nperiod removed",
487487
color = "black",
488-
size = 11,
488+
size = 9,
489489
angle = 90) +
490490
# geom_vline(xintercept = as.numeric(year_breaks), color = "red", linetype = "dashed", size = 1) +
491491
# geom_text(data = data.frame(x = year_breaks, y = rep(min(result_data$noRides), length(year_breaks)), year = substr(year_breaks, 3, 4)),
@@ -501,17 +501,16 @@ wdir_time <- ggplot(result_data) +
501501
# ggtitle("wdir over time")
502502

503503
ggarrange(
504-
noRides_time, ggparagraph(text=" ", face = "italic", size = 6, color = "black"),
505-
tavg_time, ggparagraph(text=" ", face = "italic", size = 6, color = "black"),
504+
noRides_time, tavg_time, ggparagraph(text=" ", face = "italic", size = 6, color = "black"),
506505
snow_time, ggparagraph(text=" ", face = "italic", size = 6, color = "black"),
507506
wdir_time, ggparagraph(text=" ", face = "italic", size = 6, color = "black"),
508507
stringency_time,
509-
labels = c("A", "B", "", "C", "", "D", "", "E", "", "F"),
508+
labels = c("A", "B", "C", "", "", "D", "E", ""),
510509
align = "v",
511-
nrow = 11, ncol = 1,
510+
nrow = 8, ncol = 1,
512511
font.label = list(size = 37),
513512
legend = "bottom",
514-
heights = c(1.2, 0.1, 1, 0.1, 1, 0.1, 1, 0.1, 1, 0.1, 1)
513+
heights = c(1, 1, 0.1, 1, 0.1, 1, 0.1, 1)
515514
)
516515

517516
ggsave("ExploratoryAnalysis_BadWeather.pdf", dpi = 500, w = 24, h = 30)
@@ -1168,7 +1167,7 @@ plot_final_model <- ggplot(test_data %>% filter(year(date)>=2020)) +
11681167
y = mean(range(result_data$noRides)),
11691168
label = "Change of operator,\nperiod removed",
11701169
color = "black",
1171-
size = 11,
1170+
size = 9,
11721171
angle = 90) +
11731172
theme_minimal() +
11741173
xlab("Date") +

0 commit comments

Comments
 (0)