Transit Costs

EDA (Exploratory Data Analysis) with boxplots, interactive Shiny dashboard

Published

January 4, 2021

Notable topics: EDA (Exploratory Data Analysis) with boxplots, interactive Shiny dashboard

Recorded on: 2021-01-04

Timestamps by: Alex Cookson

View code

Screencast

Timestamps

countrycode
countrycode

Using countrycode function from countrycode package to convert two-letter country codes to country names

geom_errorbarh

Using geom_errorbarh function to visualize start and end times of transit projects

fct_reorder

Using fct_reorder function to reorder lines by project midpoint year

as.numeric

Using as.numeric to convert character field (real_cost) to proper numeric field

mutate_at

Using mutate_at function to apply the same function (as.numeric) to multiple fields in one line of code

geom_boxplotfct_lump

Using geom_boxplot and fct_lump to visualize cost per kilometre by country as boxplots

glue
glue

Using glue function from glue package to combine fields to make easy-to-read labels on a graph

factor

Splitting boxplots into whether they are railroads (rr) or not, using factor function and fill argument

Investigating sources of missing data for Shanghai

geom_jitter

Using geom_jitter with geom_boxplot to show distribution of items within each group

geom_boxplot

Setting geom_boxplot argument outlier.size = -1 as a hack to get rid of boxplot-generated outlier points

shiny

Starting to build a shiny app

shiny

Review of preliminary shiny app

Screencast summary

Showing how to upload code to GitHub in RStudio