Git Product home page Git Product logo

ecoharmonizer's Introduction

ecoharmonizeR

The goal of ecoharmonizeR is to โ€ฆ

Installation

This is how the installation works:

devtools::install_github("datapumpernickel/ecoharmonizeR")

Note, that one of the dependencies cannot be installed from CRAN, but is needed for the column transformation of Eurostat data. Install comRex using:

devtools::install_github("datapumpernickel/comRex")

Example

This is how you could download the same data from four different sources (note that you need API Keys for some of these packages) and harmonize them to be able to compare some of their values.

You need the dev version of comtradr to use the bulk download facility.

library(ecoharmonizeR)
library(comRex)
library(comtradr)
library(Rat.las)

digits <- 2

download_dataverse_atlas(digits = digits, years = 2010)

atlas_data <- read_dataverse_atlas(digits = digits, years = 2010) |>
  mutate(classification_code = str_c("HS",digits))


comrex_data <- cr_get_data(
  freq = "A",
  reporter = "DE",
  partner = NULL,
  product = "27",
  indicators = NULL,
  time = 2010,
  flow = "1",
  update = F,
  verbose = T,
  ds_id = "045409"
)

comtrade_data <-ct_get_data(
  reporter = 'DEU',
  frequency = "A",
  partner = "everything",
  commodity_code = "27",
  start_date = 2010,
  end_date = 2010)

comtrade_bulk <-ct_get_bulk(
  reporter = 'DEU',
  start_date = 2010,
  end_date = 2010)


clean_atlas <-
  harmonize(atlas_data, source = "atlas") |>
  filter(cmd_code == "27",
         reporter_iso == "DEU",
         time == 2010,
         flow_desc == "import")

clean_comrex <-
  harmonize(comrex_data, source = "comex") |>
  filter(cmd_code == "27",
         reporter_iso == "DEU",
         time == 2010,
         flow_desc == "import")

clean_comtrade_data <-
  harmonize(comtrade_data, source = "comtrade") |>
  filter(cmd_code == "27",
         reporter_iso == "DEU",
         time == 2010,
         flow_desc == "import")

clean_comtrade_bulk <-
  harmonize(comtrade_bulk, source = "comtrade_bulk") |>
  filter(cmd_code == "27",
         reporter_iso == "DEU",
         time == 2010,
         flow_desc == "import")

ecoharmonizer's People

Contributors

datapumpernickel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.