Skip to content

Commit

Permalink
Update with new timetable
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Jan 18, 2022
1 parent aa9c5da commit b61e68b
Show file tree
Hide file tree
Showing 5 changed files with 397 additions and 71 deletions.
21 changes: 8 additions & 13 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,19 @@ The module can be taken by students on the [Data Science and Analytics](https://

<!-- The timetable can be found: -->

<!-- - On the University's system (official): [http://timetable.leeds.ac.uk/](http://timetable.leeds.ac.uk/teaching/202021/reporting/Individual?objectclass=module&idtype=name&identifier=TRAN5340M01&&template=SWSCUST+module+Individual&days=1-7&weeks=1-52&periods=1-21) -->
<!-- - In ical format (for import into Google/Outlook/other Calendar systems): https://github.com/ITSLeeds/TDS/raw/master/timetable-2020.ics -->
<!-- - As a .csv file (for easy reading as data): https://github.com/ITSLeeds/TDS/blob/master/timetable-2020.csv -->
- On the University's system (official): [http://timetable.leeds.ac.uk/](http://timetable.leeds.ac.uk/teaching/202122/reporting/Individual?objectclass=module&idtype=name&identifier=TRAN5340M01&&template=SWSCUST+module+Individual&days=1-7&weeks=1-52&periods=1-21)
- In ical format (for import into Google/Outlook/other Calendar systems): https://github.com/ITSLeeds/TDS/raw/master/timetable-2022.ics
- As a .csv file (for easy reading as data): https://github.com/ITSLeeds/TDS/blob/master/timetable.csv (see table below)

<!-- See below for the sessions -->

<!-- The module timetable is shown in the table below. -->
The module timetable is shown in the table below.

```{r, message=FALSE, echo=FALSE, eval=FALSE}
timetable = read_csv("timetable-2020.csv")
```{r, message=FALSE, echo=FALSE}
timetable = read_csv("timetable.csv")
timetable %>%
mutate(Duration = DTEND - DTSTART) %>%
mutate(Duration = case_when(
str_detect(SUMMARY, "deadline 1") ~ Duration + 59 + 60 * 3,
Duration == min(Duration) ~ Duration + 59,
TRUE ~ Duration)) %>%
# mutate(Duration = lubridate::hour(Duration)) %>%
select(-UID, -DTEND) %>%
mutate(`Duration (Hours)` = duration) %>%
select(-description, -duration) %>%
rename_with(str_to_title) %>%
knitr::kable()
```
Expand Down
32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,35 @@ MSc courses.
<!-- The computer code accompanying the course can be found in the `code` folders. -->
<!-- To run this code you will need R and Python installed plus various packages and libraries. -->
<!-- The timetable can be found: -->
<!-- - On the University's system (official): [http://timetable.leeds.ac.uk/](http://timetable.leeds.ac.uk/teaching/202021/reporting/Individual?objectclass=module&idtype=name&identifier=TRAN5340M01&&template=SWSCUST+module+Individual&days=1-7&weeks=1-52&periods=1-21) -->
<!-- - In ical format (for import into Google/Outlook/other Calendar systems): https://github.com/ITSLeeds/TDS/raw/master/timetable-2020.ics -->
<!-- - As a .csv file (for easy reading as data): https://github.com/ITSLeeds/TDS/blob/master/timetable-2020.csv -->

- On the University’s system (official):
[http://timetable.leeds.ac.uk/](http://timetable.leeds.ac.uk/teaching/202122/reporting/Individual?objectclass=module&idtype=name&identifier=TRAN5340M01&&template=SWSCUST+module+Individual&days=1-7&weeks=1-52&periods=1-21)
- In ical format (for import into Google/Outlook/other Calendar
systems):
<https://github.com/ITSLeeds/TDS/raw/master/timetable-2022.ics>
- As a .csv file (for easy reading as data):
<https://github.com/ITSLeeds/TDS/blob/master/timetable.csv> (see
table below)

<!-- See below for the sessions -->
<!-- The module timetable is shown in the table below. -->

The module timetable is shown in the table below.

| Summary | Date | Duration (Hours) |
|:--------------------------------------------------|:-----------|-----------------:|
| TDS Lecture 1 | 2022-01-24 | 1 |
| TDS Lecture 2: The structure of transport data | 2022-01-31 | 1 |
| TDS Practical 1 | 2022-02-03 | 3 |
| TDS Practical | 2022-02-03 | 3 |
| Lecture 3: Routing | 2022-02-07 | 1 |
| TDS Practical 2: Routing | 2022-02-10 | 3 |
| TDS seminar | 2022-02-16 | 3 |
| TDS Practical 3: Data from Web Sources | 2022-02-17 | 3 |
| TDS Practical 4: OD and route data analysis | 2022-02-24 | 3 |
| TDS Lecture 3: Visualising Transport Data | 2022-03-14 | 1 |
| TDS Lecture 5: Transport Data Science in Practice | 2022-03-21 | 1 |
| TDS Practical 5: Visualisation and project work | 2022-04-28 | 3 |

<!-- # References -->
<!-- To access references collected for this course (and contribute more if you want), you can join the 'tds' Zotero group: https://www.zotero.org/groups/956304/tds -->

Expand Down
5 changes: 3 additions & 2 deletions code-r/timetable-from-ics.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

library(tidyverse)
download.file("https://outlook.office365.com/owa/calendar/[email protected]/ce6c20fb9b724845be2e4b8449f111d912766985686605660817/calendar.ics", "tds-calendar-2022.ics")
ics = calendar::ic_read("tds-calendar-2022.ics")
names(ics)
names(ics) = gsub(pattern = ";TZID=GMT Standard Time", replacement = "", x = names(ics))
head(ics$DTSTART)
calendar::ic_date(.Last.value)

tt_csv = ics %>%
mutate_at(vars(matches("DT")), calendar::ic_date) %>%
mutate_at(vars(matches("DT")), calendar::ic_datetime) %>%
mutate(date = as.Date(DTSTART), duration = DTEND - DTSTART) %>%
select(SUMMARY, DESCRIPTION, date, duration)
names(tt_csv) = tolower(names(tt_csv))
tt_csv

readr::write_csv(tt_csv, "timetable.csv")
readLines("timetable.ics")
Loading

0 comments on commit b61e68b

Please sign in to comment.