data-raw/currency_types.R

# read raw tsv, trim the character columns and remove empty columns
currency_types <- fs::path("data-raw",
                           "currency_types",
                           ext = "tsv") |>
  data.table::fread(encoding = "UTF-8") |>
  purrr::modify_if(is.character, trimws, which = "both") |>
  purrr::discard(~is.na(.x) |> all())

# save the package data in the correct format
usethis::use_data(currency_types, overwrite = TRUE)
krose/entsoeapi documentation built on June 15, 2025, 1:46 p.m.