I am following a vignette for gtfstools (https://cran.r-project.org/web/packages/gtfstools/vignettes/gtfstools.html) but am getting stuck with the data format. Basically, I am linking to a gtfs dataset, which is a zip folder with .txt files inside it.
ART2019Path <- file.path(GTFS_path, "2019-10 Arlington.zip")
ART2019GTFS <- read_gtfs(ART2019Path)
Here is the data: https://realtime.commuterpage.com/rtt/public/utility/gtfs.aspx
The data loads fine but it is automatically read as all characters. I need most of the data to be numeric for my data analysis purposes. For example, showing transit geometry:
trip_geom <- get_trip_geometry(ART2019GTFS, file = "shapes")
plot(trip_geom$geometry)
I tried mutating all data, assuming data without numbers would stay as characters, but it didn't work:
ART2019GTFS <- mutate_all(ART2019GTFS, funs(as.numeric))
I am relatively new to R so not sure how to tackle this.
Any help figuring this out would be appreciated.
When I follow that link I get a zip file named
google_transit.zip
which has several comma separated text files in it. When I runthis:I get this (one dataframe for each text file):
And then this apparently succeeds: