Skip to content

Instantly share code, notes, and snippets.

@njtierney
Created May 20, 2020 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njtierney/21a84d9ce7f8d0b2aa4db51af9dbbab5 to your computer and use it in GitHub Desktop.
Save njtierney/21a84d9ce7f8d0b2aa4db51af9dbbab5 to your computer and use it in GitHub Desktop.
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