Last active
June 15, 2021 13:37
-
-
Save joaomacalos/857ad85a4b35858e52ccde7bffeac64a to your computer and use it in GitHub Desktop.
comparison-r1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load required packages | |
| library(tidyverse) | |
| library(lubridate) | |
| # Read csv | |
| commodities <- read_csv('../../../Datasets/imf-commodities.csv') | |
| # Tidy | |
| commodities <- commodities %>% | |
| select(date = Commodity, comm = PALLFNF) %>% | |
| slice(4:n()) %>% | |
| drop_na() %>% | |
| mutate( | |
| date = ym(date), | |
| comm = as.numeric(comm) | |
| ) | |
| # Display first entries | |
| head(commodities) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment