Bike sharing in 100 cities

July 22, 2013
By

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

Many cities around the world have bike sharing programs: pick up a bike at a docking station, ride it across town and drop it off at another session, and just pay for the time you use. (Even Albacete, the Spanish college down hosting last month's UseR conference, had one.) Most of these systems provide open data feeds of bike availability, and the data is available for all cities via the CityBikes API. Ramnath Vaidyanathan used this API to create an on-line application showing the real-time status of bike availability in over 100 cities. Here's London, for example:

London bikes

Red dots indicate bikeshare stations with zero available bikes; green dots show stations with the most availability. (I took the snapshot above around midnight London time: it looks like all the city-center bikes have been taken to the outlying stations by commuters, and the overnight redistribution hasn't yet taken place.)

Ramnath used an R language script to download the data from the JSON API (using the httr package), and created the maps using the rCharts packages (which provides an interface to Leaflet maps). The interactive application, with city selection, pan and zoom, and pop-up detail for each station, was created using RStudio's Shiny package for R. It's easy to imagine other applications for this data, for example using statistical forecasting to optimize the overnight redistribution, or to determine the most popular bike routes in a city.

Click the map above to play around with the application yourself, or follow the link below for more details from Ramnath on how the application was created.

Ramnath Vaidyanathan: Visualizing Bike Sharing Networks

To leave a comment for the author, please follow the link and comment on his blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.