In [1]:
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.
In [2]:
divvy <- read.divvy.data()
In [3]:
print(head(divvy$stations),row.names = FALSE)
In [4]:
nrow(divvy$stations)
We also have information about the >3 million trips taken on Divvy bikes in 2016.
In [5]:
print(head(divvy$trips),row.names = FALSE)
In [6]:
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.
In [7]:
departures <- table(divvy$trips$from_station_name)
as.matrix(head(sort(departures,decreasing = TRUE)))
In [8]:
sum(divvy$trips$from_station_name == "University Ave & 57th St",na.rm = TRUE)
In [9]:
system("jupyter --version",intern = TRUE)
This is the version of R and the packages that were used to generate these results.
In [10]:
sessionInfo()