gtfs_path <- system.file("extdata/ggl_gtfs.zip", package = "gtfsio")
# read all files and columns
gtfs <- import_gtfs(gtfs_path)
names(gtfs)
names(gtfs$trips)
# read all columns from selected files
gtfs <- import_gtfs(gtfs_path, files = c("trips", "stops"))
names(gtfs)
names(gtfs$trips)
# read specific columns from selected files
gtfs <- import_gtfs(
gtfs_path,
files = c("trips", "stops"),
fields = list(
trips = c("route_id", "trip_id"),
stops = c("stop_id", "stop_lat", "stop_lon")
)
)
Run the code above in your browser using DataLab