title | subtitle | author | date | output | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A 5-year comparison of local currency value in Mexico compared to the US dollar |
From February 1st, 2018 to February 1st, 2023 |
Felipe Valencia |
febrero 02, 2023 |
|
# Import datasets
data <- read.csv("https://github.com/felipevalenciaclavijo/USD-MXN-1Feb2019to1Feb2023/blob/main/USD_MXN%20Historical%20Data.csv?raw=true")
Create and include a line graph showing a 5-year comparison of local currency value in Mexico compared to the US dollar
Fix date format.
# Use this R-Chunk to clean & wrangle your data!
data$Date <- as.Date(data$Date, "%m/%d/%Y")
# Use this R-Chunk to plot & visualize your data!
price_over_time <- ggplot(data = data, mapping = aes(x = Date, y = Price)) +
geom_line(linewidth = 0.8) +
theme_bw() +
theme(plot.title = element_text(hjust = .5),
plot.subtitle = element_text(hjust = .5)) +
labs(title = "Daily USD/MXN - US Dollar Mexican Peso Evolution", subtitle = "From February 1st, 2018 to February 1st, 2023", y = "Price (MXN)", caption = "Data from Investing.com") +
scale_x_date(date_breaks = "1 year", date_labels = "%Y")
price_over_time
# ggsave("Daily_USD-MXN_5years.png")
We can see the evolution of the USD/MXN for the last 5 years and we notice a huge increase in early 2020, perfectly aligning with Covid-19 outbreak.