This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(lubridate) | |
#reading in data that I copied and pasted | |
data <- tibble::tribble( | |
~date, ~no_of_jobs, | |
"January 2006", 2439100L, | |
"February 2006", 2444400L, | |
"March 2006", 2458700L, | |
"April 2006", 2458500L, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
#if not installed, install the colorspace package | |
#install.packages("colorspace") | |
library(colorspace) | |
#Your turn | |
#This is some data for a line chart | |
air <- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
#if not installed, install the colorspace package | |
#install.packages("colorspace") | |
library(colorspace) | |
#Your turn | |
#This is some data for a line chart | |
air <- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
#Your turn solutions | |
#This is some data for a line chart | |
air <- | |
airquality %>% | |
filter(Month == 5) %>% | |
select(Temp, Ozone, Wind, Day) %>% | |
pivot_longer(cols = 1:3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
#Your turn | |
#This is some data for a line chart | |
air <- | |
airquality %>% | |
filter(Month == 5) %>% | |
select(Temp, Ozone, Wind, Day) %>% | |
pivot_longer(cols = 1:3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(ggtext) | |
##Your turn | |
#Use ggtext to make the word 'plastic' bold in the title | |
#and wrap the subtitle so it is multi-line | |
plastics <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-01-26/plastics.csv') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(ggtext) | |
##Your turn | |
#Use ggtext to make the word 'plastic' bold in the title | |
#and wrap the subtitle so it is multi-line | |
plastics <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-01-26/plastics.csv') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#using custom fonts is enabled by the ragg package | |
#install.packages("ragg") | |
library(ggplot2) | |
library(ragg) | |
##Your turn | |
#Take one of the charts we've made and add your own fonts to it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#using custom fonts is enabled by the ragg package | |
#install.packages("ragg") | |
library(ggplot2) | |
library(ragg) | |
##Your turn | |
#Take one of the charts we've made and add your own fonts to it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(patchwork) | |
#Solutions | |
#Using charts in plastic_charts.R | |
#Create a patchwork with one chart in a lefthand column | |
#spanning two vertical rows, and two charts in a second column | |
#stacked on top of each other | |
patchwork <- bar_chart | (bar_chart_2 / pie_chart) |
NewerOlder