Media Franchise Revenue

Data manipulation (especially re-ordering factors)

Published

June 21, 2019

Notable topics: Data manipulation (especially re-ordering factors)

Recorded on: 2019-06-21

Timestamps by: Alex Cookson

View code

Screencast

Timestamps

semi_join

Explaining use of semi_join function to aggregate and filter groups

Putting the largest categories on the bottom of a stacked bar chart

glue
glue

Using glue function as alternative to paste for combining text, plus good explanation of it

fct_reorder

Multiple re-ordering using fct_reorder function of facetted graph (he works through several obstacles)

Re-ordering the position of facetted graphs so that highest total revenue is at top left

Investigating relationship between year created and revenue

geom_text

Creating scatter plot with points scaled by size and labelled points (geom_text function)

Summary of screencast up to this point

Starting analysis original media of franchise (e.g., novel, video game, animated film) and revenue type (e.g., box office, merchandise)

fct_reorder

Graphing original media and revenue category as facetted bar plot with lots of reordering (ends at around 38:40)

geom_tile

Alternative visualization of original media/revenue category using heat map

scale_fill_gradient2

Using scale_fill_gradient2 function to specify custom colour scale

Getting rid of gridlines in graph using theme function's panel.grid argument

fct_rev

Using fct_rev function to reverse levels of factors

Fixing overlapping axis text with tweaks to theme function's axis.text argument

Reviewing visualization that inspired this dataset

Adding text of total revenue to the end of each bar in a previous graph

paste0

Using paste0 function at add a "B" (for "billions") to the end of text labels on graph

expand_limits

Using expand_limits functions to give more space for text labels not to get cut off

Summary of screencast