Giter Site home page Giter Site logo

ameco's Introduction

AMECO Dataset

Travis-CI Build Status CRAN_Status_Badge CRAN_Logs_Badge

This package contains the entire European Commission Annual macro-economic (AMECO) database in a format amenable to analysis in R.

Install it from either CRAN or Github:

# From CRAN
install.packages("ameco")

# From Github
devtools::install_github("expersso/ameco")

Simple example

The dataset is in a clean, long format:

library(dplyr)
library(ameco)
head(ameco)
## # A tibble: 6 x 8
##   code              country   sub.chapter  title  unit  cntry  year  value
##   <chr>             <chr>     <chr>        <chr>  <chr> <chr> <dbl>  <dbl>
## 1 EU28.1.0.0.0.NPTD European~ 01 Populati~ Total~ 1000~ EU28   1960 409118
## 2 EU15.1.0.0.0.NPTD European~ 01 Populati~ Total~ 1000~ EU15   1960 316765
## 3 EA19.1.0.0.0.NPTD Euro area 01 Populati~ Total~ 1000~ EA19   1960 265029
## 4 EA12.1.0.0.0.NPTD Euro are~ 01 Populati~ Total~ 1000~ EA12   1960 252350
## 5 DU15.1.0.0.0.NPTD EU15 (in~ 01 Populati~ Total~ 1000~ DU15   1960 299421
## 6 DA12.1.0.0.0.NPTD EA12 (in~ 01 Populati~ Total~ 1000~ DA12   1960 235006

Filtering with the sub.chapter variable allows you to easily find the variable of interest:

ameco %>% 
  filter(sub.chapter == "01 Population") %>% 
  .$title %>% 
  unique()
## [1] "Total population (National accounts)"
## [2] "Total population"                    
## [3] "Population: 0 to 14 years"           
## [4] "Population: 15 to 64 years"          
## [5] "Population: 65 years and over"

Being interested in the total population of a few countries, we can easily subset the data and plot the results:

library(ggplot2)

ameco %>% 
  filter(title == "Total population",
         year == 2015,
         cntry %in% c("USA", "JPN", "DEU", "FRA", "ESP", "ITA")) %>% 
  ggplot(aes(x = reorder(country, -value), y = value / 1000)) +
  geom_bar(stat = "identity") +
  theme_bw() +
  labs(x = NULL, y = "Population (millions)", title = "Total population")

Disclaimer

This package is not affiliated with, nor endorsed by, the European Commission. I aim to update it whenever the AMECO database is updated. If you ever see that it is out-of-date, don’t hesitate to send a pull request and/or remind me to update it.

ameco's People

Contributors

expersso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ameco's Issues

Outdated data

@expersso
It seems that the data in the package has not been updated since 9 November 2017 (the date stated in the readme.md. The last AMECO database update took place 3 May 2018 (see AMECO website).

Is there any chance that the package will be updated soon?

the data in the ameco package not matching AMECO Online data

I installed your package from GitHub, and compared the data to the Online version of AMECO and it doesn't match.

R AMECO package data:
amecodata <- ameco %>% dplyr::filter(sub.chapter == "01 Gross domestic product", title == "Gross domestic product at current prices", year %in% c(2014), unit == "(Mrd PPS)", cntry %in% c("ITA", "DEU", "FRA", "GBR", "CHE"))

Screenshot attached of same variable in AMECO Online:
screen shot 2016-01-18 at 21 50 06

Looks like the database has been updated since this package has been committed: Last update : 05/11/2015

Or am I doing something wrong?

Spring 2017 data

The data is still outdated. It corresponds to data from Spring 2017.
e.g.:

library(ameco)

library(dplyr)

View(ameco[ameco[,"code"] == "EU28.1.0.0.0.NPTD",])

Compare the first line of this data to the data obtained from the current AMECO data: https://ec.europa.eu/info/business-economy-euro/indicators-statistics/economic-databases/macro-economic-database-ameco/download-annual-data-set-macro-economic-database-ameco_en. Then compare it to the data of Spring 2017: http://ec.europa.eu/economy_finance/db_indicators/ameco/archive_en.htm

In your ameco.R file it is stated as a comment that you are downloading the .zip file from: https://ec.europa.eu/info/files/all-zipped-text-files_en

I supposed that this site is somehow broken.

Issues loading package

Hi!
I'm having some trouble installing this package from either CRAN or Github.

When I try to install it from CRAN I get this error message:

Installing package into ‘C:/Users/.../Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘ameco’ is not available (for R version 3.6.3)

When I try to install it from Github I get this message:

Error: Failed to install 'ameco' from GitHub:
create process 'C:/PROGRA1/R/R-361.3/bin/x64/Rcmd.exe' (system error 267, The directory name is invalid.
) @win/processx.c:1040 (processx_exec)

Is there any way I can still get the data, or that you could help patch this issue? Thank you!

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.