authors: Peter Carbonetto, Gao Wang
Here, we will take a brief look at the data provided by Divvy.
We begin by loading a few packages, as well as some additional R functions implemented for this project.
library(data.table)
source("../code/functions.R")
Function read.divvy.data
reads in the trip and station data from the Divvy CSV files. This function uses fread
from the data.table
package to quickly read in the data (it is much faster than read.table
). This function also prepares the data, including the departure dates and times, so that they are easier to work with.
divvy <- read.divvy.data()
We have data on 581 Divvy stations across the city.
print(head(divvy$stations),row.names = FALSE)
nrow(divvy$stations)
We also have information about the >3 million trips taken on Divvy bikes in 2016.
print(head(divvy$trips),row.names = FALSE)
nrow(divvy$trips)
Out of all the Divvy stations in Chicago, the one on Navy Pier (near the corner of Streeter and Grand) had the most activity by far.
departures <- table(divvy$trips$from_station_name)
as.matrix(head(sort(departures,decreasing = TRUE)))
In subsequent analyses, we will also take a close look at the trip data for the main Divvy station on the University of Chicago campus. The Divvy bikes were rented almost 8,000 times in 2016 at this location.
sum(divvy$trips$from_station_name == "University Ave & 57th St",na.rm = TRUE)
This is the version of Jupyter used to generate these results.
system("jupyter --version",intern = TRUE)
This is the version of R and the packages that were used to generate these results.
sessionInfo()
Exported from analysis/first-glance.ipynb
committed by Peter Carbonetto on Wed Mar 7 03:16:30 2018 revision 11, c2d196c