This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(proporz) | |
# data set | |
votes_matrix = pivot_to_matrix(finland2019$votes_df) | |
party_votes = rowSums(votes_matrix) | |
district_seats = finland2019$district_seats_df$election_mandates | |
names(district_seats) <- finland2019$district_seats_df$entity_id | |
# calculate the seat distribution in each district with a given method | |
# returns the national seat distribution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from = "Berlin Hauptbahnhof" | |
start_time = 8 * 3600 | |
gtfsrouter::berlin_gtfs_to_zip() | |
gtfs_file = paste0(tempdir(), "/vbb.zip") | |
# 1a) tidytransit ##### | |
suppressMessages({ | |
library(tidytransit) | |
library(dplyr) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidytransit) | |
library(dplyr) | |
library(tidytable) | |
# https://opentransportdata.swiss/de/dataset/timetable-2021-gtfs2020/resource/10ed3c73-231e-49ba-beac-2df54de48c29 | |
g = read_gtfs("gtfs_fp2021_2021-11-24_09-10.zip") | |
summary(g) | |
#> tidygtfs object | |
#> files agency, stops, routes, trips, stop_times, calendar, calendar_dates, transfers, feed_info | |
#> agencies Schweizerische Bundesbahnen SBB, Sihltal-Zürich-Uetliberg-Bahn, BLS AG (bls) ... 459 more |