-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadjusted_delays.Rmd
67 lines (41 loc) · 1.15 KB
/
adjusted_delays.Rmd
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
49
50
---
title: "testVBZ"
output: html_document
#test code
library(tidyverse)
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
```
```{r}
delay1 = read.csv("/Users/bgppermp/docs/zurich_data_day/data/delay_data/fahrzeitensollist2015092020150926.csv")
```
```{r}
#make_delays <- function(tibble_name,){
work.line <- 33
delay2 <- delay1 %>%
select(linie,umlauf_von,halt_id_nach,halt_id_von,soll_ab_von,ist_ab_von,soll_an_nach,ist_an_nach1,
soll_an_von,ist_an_von,halt_punkt_id_von,halt_punkt_id_nach) %>%
filter(linie == work.line) %>%
#first calculate delays during segments of the line
mutate(soll_seg = soll_an_nach - soll_ab_von,
ist_seg = ist_an_nach1 - ist_ab_von,
delay_seg = soll_seg - ist_seg,
# below is the delay at the station
soll_at_von = soll_ab_von - soll_an_von,
ist_at_von = ist_ab_von - ist_an_von,
delay_von = ist_at_von - soll_at_von,
index = paste(as.character(linie),'-',as.character(halt_punkt_id_von),'-',as.character(halt_punkt_id_nach))
)
# }
```
```{r}
names(delay1)
```
```{r}
names(delay2)
```
```{r}
```