Capital Bikeshare: Visualizing Washington DC biking activity

[This article was first published on FI Labs - R Feed, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Capital Bikeshare has provided almost 15 million bike rides across the greater Washington, DC, area over the six years it has been in existence. That’s a lot of happy commuters and tourists avoiding the gnarly DC traffic and the depths of the Washington Metro.

Where are all of these happy bicyclists pedaling? We wanted to animate the entire six year history of Capital Bikeshare superimposed on a map of DC, and then provide a time lapse over a couple brief minutes. To ease the burden on your eyes and our server of processing 15 million paths, we chose to animate the rides over a shorter time period. Click the link to see the bike rides during the afternoon of New Year’s Day 2011. Perhaps one of those dots represents you and your borrowed big red bike.

Capital Bikeshare Visualization

Here are additional items of interest gathered from the 15 million rows of data generously made public by Capital Bikeshare.

Ridership over time

Ridership has increased considerably over the last six years, from fewer than 2,000 riders on the busiest day in 2010 to over 12,000 on the busiest 2016 day.


Warm summer months have seen a particular increase in bicyclists over time. In fact, the frigid DC January and February months saw mostly flat ridership until 2016.


Capital Bikeshare offers two ways to rent bikes. One way is designed for visitors to DC, where riders can purchase a casual membership for one to five days. The other is a registered members for locals for either monthly or annual membership. Registered membership has taken off since 2010, whereas the growth in casual ridership has been more measured.


By viewing ridership by both season and rider type, we see that the growth in registered users has come from summer months. In fact, winter usage among registered users has actually decreased each year since 2013 and only as recently as 2016 saw an uptick.


Busiest stations

Columbus Circle / Union Station is the busiest station in all of DC with 294,046 trips from this station. This was followed by Massachusetts Ave & Dupont Circle NW and Lincoln Memorial.

On April 19, 2016, 362 trips originated from Columbus Circle. Here are all of them animated (refresh your browser if the lines aren’t moving).

Technical notes

Data were obtained from a data set made public by Capital Bikeshare and processed using R. Bike paths were determined using a Google Maps API. Visualizations were created using the d3 JavaScript library.

All code for processing data can be found on Github. Code for bike animations is also on Github.

To leave a comment for the author, please follow the link and comment on their blog: FI Labs - R Feed. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)