f <- system.file("extdata", "beartransit-ca-us.zip", package = "stplanr")
# update file to latest version
# see https://code.google.com/p/googletransitdatafeed/wiki/PublicFeeds
u <- "http://data.trilliumtransit.com/gtfs/beartransit-ca-us/beartransit-ca-us.zip"
# download.file(u, f)
gtfs <- gtfs2sldf(gtfszip = f)
plot(gtfs, col = gtfs$route_long_name)
plot(gtfs[gtfs$route_long_name == "Central Campus",])
## Not run:
# # An example of a larger gtfs feed
# download.file("http://www.yrt.ca/google/google_transit.zip",
# paste0(tempdir(),"/gtfsfeed.zip"))
# yrtgtfs <- gtfs2sldf(paste0(tempdir(),"/gtfsfeed.zip"))
# sp::plot(yrtgtfs,col=paste0("#",yrtgtfs$route_color))
# ## End(Not run)
Run the code above in your browser using DataLab