#install.packages('dslabs')
library('dslabs')
library(ggplot2)
## Registered S3 methods overwritten by 'ggplot2':
## method from
## [.quosures rlang
## c.quosures rlang
## print.quosures rlang
library(extrafont)
## Registering fonts with R
library(ggthemes)
data1 <- greenhouse_gases
head(data1)
## year gas concentration
## 1 20 CO2 277.7
## 2 40 CO2 277.8
## 3 60 CO2 277.3
## 4 80 CO2 277.3
## 5 100 CO2 277.5
## 6 120 CO2 277.6
plot <- ggplot(data1, aes(year, concentration)) +
geom_line() +
facet_grid(gas ~ ., scales = "free") +
xlab("Year") +
ylab("Concentration") +
ggtitle("Atmospheric greenhouse gases")+
theme_economist()
plot
