Seattle Bike Counts

NA

Published

April 4, 2019

Notable topics: NA

Recorded on: 2019-04-04

Timestamps by: Alex Cookson

View code

Screencast

Timestamps

summarise_allsummarise_at

Using summarise_all / summarise_at function to aggregate multiple variables at the same time

Using magnitude instead of absolute numbers to see trends in time of day

between

Dividing time into categories (four categories for times of day, e.g., morning commute, night) using between function

Looking for systematically missing data (which would bias the results of the analysis)

Summarising using a filter in the arguments based on whether the time window is during a commute time

as.difftime
lubridate

Combining day of week and hour using functions in the lubridate package and as.difftime function (but then he uses facetting as an easier method)

Normalizing day of week data to percent of weekly traffic

Starting analysis of directions of travel by time of day (commute vs. reverse-commute)

wday
lubridate

Filtering out weekend days using wday function from lubridate package

spread

Using spread function to create new variable of ratio of bike counts at different commute times

Visualizing ratio of bike counts by time of day

Visualizing ratio by hour instead of time of day

Ordering crossing in graph by when the average trip happened using mean of hour weighted by bike count

mutate

Quick and dirty filter when creating a new variable within a mutate function