econtools

Tools to Analyze Economic Data

https://github.com/tidy-intelligence/r-econtools

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.3%) to scientific vocabulary

Keywords

economic-data r
Last synced: 9 months ago · JSON representation

Repository

Tools to Analyze Economic Data

Basic Info
Statistics
  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
economic-data r
Created over 1 year ago · Last pushed 9 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# econtools


[![CRAN status](https://www.r-pkg.org/badges/version/econtools)](https://cran.r-project.org/package=econtools)
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/econtools)](https://cran.r-project.org/package=econtools)
![R CMD Check](https://github.com/tidy-intelligence/econtools/actions/workflows/R-CMD-check.yaml/badge.svg)
![Lint](https://github.com/tidy-intelligence/econtools/actions/workflows/lint.yaml/badge.svg)
[![Codecov test coverage](https://codecov.io/gh/tidy-intelligence/econtools/graph/badge.svg)](https://app.codecov.io/gh/tidy-intelligence/econtools)


Provides a consistent set of functions for enriching and analyzing sovereign-level economic data. Economists, data scientists, and financial  professionals can use the package to add standardized identifiers, demographic and macroeconomic indicators, and derived metrics such as  gross domestic product per capita or government expenditure shares.

The package is part of the [EconDataverse](https://www.econdataverse.org/) family of packages aimed at helping economists and financial professionals work with sovereign-level economic data.

## Installation

You can install `econtools` from [CRAN](https://cran.r-project.org/package=econtools) via:

``` r
install.packages("econtools")
```

You can install the development version of `econtools` from [GitHub](https://github.com/) with:

``` r
# install.packages("pak")
pak::pak("tidy-intelligence/econtools")
```

## Usage

This is a basic example which shows you how to solve a common problem:

```{r example}
library(econtools)
```

```{r}
df <- data.frame(
  id = rep("USA", 5),
  name = c("United States", "United.states", "US", "USA", "United States"),
  year = 2019:2023,
  gross_domestic_product = c(2.15e13, 2.14e13, 2.37e13, 2.60e13, 2.77e13)
)

add_population_column(df, id_column = "name", id_type = "regex")
```

The simplest way to add additional information is using an ISO 3166-1 alpha-3 code.

Add most recent population number:
```{r}
add_population_column(df, id_column = "id")
```

Add population by year:

```{r}
add_population_column(df, id_column = "id", date_column = "year")
```

Similarly, for poverty ratio:
```{r}
add_poverty_ratio_column(df, id_column = "id", date_column = "year")
```

Create a new column that calculates a value relative to the population, for instance GDP per capita:
```{r}
add_population_share_column(
  df,
  id_column = "id",
  date_column = "year",
  value_column = "gross_domestic_product"
)
```

Add income levels via:

```{r}
add_income_level_column(df, id_column = "id")
```

If you want to use another column and automatically map identifiers to a new `entity_id` column using the `econid` package:

```{r}
add_population_column(df, id_column = "name", id_type = "regex")
```

If you only want to add ISO-3 codes:

```{r}
add_iso3_codes_column(df, "name")
```

You can also add a column with standardized names:

```{r}
add_short_names_column(df, "name")
```

Finally, you can add columns from IMF World Economic Outlook (WEO) data such as the GDP in national currency

```{r}
add_gdp_column(df, id_column = "id", date_column = "year", usd = FALSE)
```

Or the government expenditure (only available in national currency): 

```{r}
add_gov_exp_column(df, id_column = "id", date_column = "year")
```

And share of government expenditure to GDP: 

```{r}
add_gov_exp_share_column(df, id_column = "id", date_column = "year")
```

## Contributing

Contributions to `econtools` are welcome! If you’d like to contribute,
please follow these steps:

1.  **Create an issue**: Before making changes, create an issue
    describing the bug or feature you’re addressing.
2.  **Fork the repository**: After receiving supportive feedback from
    the package authors, fork the repository to your GitHub account.
3.  **Create a branch**: Create a branch for your changes with a
    descriptive name.
4.  **Make your changes**: Implement your bug fix or feature.
5.  **Test your changes**: Run tests to ensure your changes don’t break
    existing functionality.
6.  **Submit a pull request**: Push your changes to your fork and submit
    a pull request to the main repository.

Owner

  • Name: Tidy Intelligence
  • Login: tidy-intelligence
  • Kind: organization
  • Email: contact@tidy-intelligence.com
  • Location: Germany

Let your data spark joy (coming soon!)

GitHub Events

Total
  • Issues event: 6
  • Watch event: 2
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 22
  • Pull request event: 4
  • Create event: 3
Last Year
  • Issues event: 6
  • Watch event: 2
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 22
  • Pull request event: 4
  • Create event: 3

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 4
  • Total pull requests: 2
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 5 days
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 2
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 5 days
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • christophscheuch (4)
Pull Request Authors
  • christophscheuch (2)
Top Labels
Issue Labels
enhancement (3) release (1)
Pull Request Labels
enhancement (1) release (1)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 39 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: econtools

Enrich and Analyze Sovereign-Level Economic Data

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 39 Last month
Rankings
Dependent packages count: 25.6%
Stargazers count: 27.1%
Forks count: 29.0%
Dependent repos count: 31.4%
Average: 39.7%
Downloads: 85.3%
Last synced: 9 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
  • r-lib/actions/setup-tinytex v2 composite
.github/workflows/lint.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • codecov/codecov-action v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R >= 4.1 depends
  • cli * imports
  • dplyr >= 1.0.0 imports
  • rlang * imports
  • wbwdi * imports