install.packages("remotes") remotes::install_github("rejustify/r-package") library(rejustify)
setCurl() register(token = "YOUR_TOKEN", email = "YOUR_EMAIL")
months <- as.yearmon(seq(as.Date(Sys.time()), length = 12, by = "-1 month")) df <- data.frame(months = as.character(rev(months)), `EUR,PLN` = NA, check.names = FALSE, stringsAsFactors = FALSE)
st <- analyze(df)
st <- adjust(st, id = 1, items = list("class" = "time", "feature" = "month", "format" = "%b %Y")) st <- adjust(st, id = 2, items = list("class" = "general", "feature" = NA)) st <- adjust(st, id = 3, items = list("class" = "general", "feature" = NA)) st <- adjust(st, column = 2, items = list("class" = "general", "feature" = NA, "provider" = "ECB", "table" = "EXR"))
rdf <- fill(df, st) vis(rdf)
def <- adjust(rdf$default, column = 2, items = list("Frequency" = "M", "Currency" = "PLN", "Currency denominator" = "EUR", "Exchange rate type" = "SP00", "Series variation - EXR context" = "A")) #or "E" depending on transformation
key <- adjust(rdf$keys, column = 2, items = list("id.x" = c(1,2,3), "id.y" = c(6,3,2), "class" = c("time", "general", "general"), "method" = c("time-matching", "value-selection", "value-selection")))
rdf <- fill(df, st, default = def, keys = key)