# \donttest{
library(ugatsdb)
library(magrittr) # Pipe %>% operators
library(xts) # Time series class and pretty plots
# Plotting daily IFEM Buying and Selling Rates from the Bank of Uganda
get_data("BOU_E", c("E_IFEM_B", "E_IFEM_S"), from = 2020) %>%
as.xts %>% plot
library(dygraphs)
# Same generating a dynamic chart
get_data("BOU_E", c("E_IFEM_B", "E_IFEM_S"), from = 2020) %>%
as.xts %>% dygraph
# Static plot but with legend showing variable labels
get_data("BOU_E", c("E_IFEM_B", "E_IFEM_S"), from = 2020, wide = FALSE) %>%
long2wide(names_from = "Label") %>% as.xts %>%
plot(legend.loc = "topleft")
# }
Run the code above in your browser using DataLab