Visualising Music Sales

Intro This document presents possible solutions to the assignment given during the workshop on dataviz, Ph.D. retreat 2022. Preparation Libraries library(tidyverse) library(cowplot) library(gghighlight) library(knitr) library(MetBrewer) Loading data music <- read_csv("https://raw.githubusercontent.com/lescai-teaching/dataviz-rstudio/datasets/music_sales_history.csv", col_names = c("format", "metric", "year", "records", "value"), col_types = c(col_character(), col_character(), col_double(), col_double(), col_double()), skip = 1) Tidying the data simplifying the column name music$metric <- ifelse( music$metric == "Value (Adjusted)", "adjusted_value", music$metric ) some data are duplicated or missing...

May 24, 2022 · Package Build

Storytelling with ggplot2

Loading data To showcase the approach to storytelling, we have chosen a dataset on Attitudes towards Mental Illnesses. This is the collection of 2016 OSMI survey results. First we need to load the necessary packages: library(tidyverse) library(cowplot) library(gghighlight) library(knitr) library(MetBrewer) library(treemapify) library(kableExtra) Then we can load the dataset straight from the repository on github: data <- read_csv("https://raw.githubusercontent.com/lescai-teaching/dataviz-rstudio/datasets/mental-heath-in-tech-2016_20161114.csv") We can now inspect what the dataset contains, by printing a table of its variables:...

May 18, 2022 · Francesco