Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
install.packages("devtools")
library(devtools)
devtools::install_github("cloudyr/aws.signature")
devtools::install_github("keboola/sapi-r-client")
library(keboola.sapi.r.client)
client <- SapiClient$new('452-33945-de5bb7fecb818901f0834b2431564003296a4b05')
currencyData <- client$importTable('in.c-ex-currency.rates')
# prepare our data
eurVsUsd <- currencyData[which(currencyData$toCurrency == "USD"),]
eurVsUsd$date <- as.Date(eurVsUsd$date)
# load the libraries needed to make our plot
library(ggplot2)
library(scales) # for prettier x-axis labeling
p <- ggplot(eurVsUsd, aes_string(x="date", y="rate")) + geom_point()
# add x-axis scaling and title
p <- p + scale_x_date(breaks="1 year", labels=date_format("%Y"))
p <- p + ggtitle("EUR vs USD")
print(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment