Skip to content

Instantly share code, notes, and snippets.

@joaomacalos
Last active June 15, 2021 13:37
Show Gist options
  • Select an option

  • Save joaomacalos/857ad85a4b35858e52ccde7bffeac64a to your computer and use it in GitHub Desktop.

Select an option

Save joaomacalos/857ad85a4b35858e52ccde7bffeac64a to your computer and use it in GitHub Desktop.
comparison-r1
# 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