Created
May 20, 2020 02:19
-
-
Save njtierney/21a84d9ce7f8d0b2aa4db51af9dbbab5 to your computer and use it in GitHub Desktop.
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(gridExtra) | |
rates <- read_csv("https://raw.githubusercontent.com/numbats/ida/master/slides/data/rates_new.csv") | |
rates <- rates %>% | |
distinct() %>% | |
arrange(date) | |
p1 <- ggplot(rates, aes(x=date, y=AUD)) + geom_line() | |
p2 <- ggplot(rates, aes(x=date, y=EUR)) + geom_line() | |
p3 <- ggplot(rates, aes(x=date, y=JPY)) + geom_line() | |
p4 <- rates %>% select(date, AUD, EUR, JPY) %>% | |
gather(curr, value, -date) %>% | |
ggplot(aes(x=date, y=value, colour=curr, group=curr)) + | |
geom_line() + theme(legend.position="none") + | |
scale_colour_brewer(palette="Dark2") | |
grid.arrange(p1, p2, p3, p4, ncol=2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment