Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.63 KB

USD-MXN-1Feb2019to1Feb2023.md

File metadata and controls

64 lines (45 loc) · 1.63 KB
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
html_document
keep_md toc toc_float code_folding fig_height fig_width fig_align
true
true
true
hide
6
12
center
# Import datasets
data <- read.csv("https://github.com/felipevalenciaclavijo/USD-MXN-1Feb2019to1Feb2023/blob/main/USD_MXN%20Historical%20Data.csv?raw=true")

Background

Create and include a line graph showing a 5-year comparison of local currency value in Mexico compared to the US dollar

Data Wrangling

Fix date format.

# Use this R-Chunk to clean & wrangle your data!
data$Date <- as.Date(data$Date, "%m/%d/%Y")

Data Visualization

# 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")

Conclusions

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.