useeior
Estimating potential environmental impacts of goods and services in the US economy
Science Score: 49.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
Found 7 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
1 of 16 committers (6.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.2%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Estimating potential environmental impacts of goods and services in the US economy
Basic Info
Statistics
- Stars: 36
- Watchers: 10
- Forks: 31
- Open Issues: 13
- Releases: 24
Topics
Metadata Files
README.md
useeior 
useeior is an R package for building and using USEEIO models.
The model object is the primary output that is built according to a given model specification and optional hybridization specification, e.g. disaggregation. Model specifications and associated hybridization specifications, e.g. disaggregation, for EPA-validated models are included in the package.
useeior offers various functions for validating, calculating, visualizing, and writing out models and/or their components.
useeior is a core component of the USEEIO Modeling Framework and is in a stable development state.
Users intending to use the package for production purposes and applications should use Releases.
useeior v1.0.0 was peer-reviewed internally at USEPA and published at Zenodo.
An peer-reviewed article describing useeior was published in the journal Applied Sciences in April 2022.
If you use useeior in a scientific publication, we would appreciate that you cite it using:
@article{li_useeior_2022,
title = {useeior: {An} {Open-Source} {R} {Package} for {Building} and {Using} {US} {Environmentally-Extended} {Input-Output} {Models}},
journal = {Applied Sciences},
author = {{Li, Mo} and {Ingwersen, Wesley} and {Young, Ben} and {Vendries, Jorge} and {Birney, Catherine}},
year = {2022},
pages = {4469},
number = {9},
volume = {12},
doi = {10.3390/app12094469}
}
or
Li, M., Ingwersen, W.W., Young, B., Vendries, J. and Birney, C., 2022. useeior: An Open-Source R Package for Building and Using US Environmentally-Extended Input–Output Models. Applied Sciences, 12(9), p.4469.
See the following sections for installation and basic usage of useeior.
See Wiki for advanced uses, details about built-in data and metadata and how to contribute to useeior.
Installation
```r
Install development version from GitHub
install.packages("devtools") devtools::install_github("USEPA/useeior") ```
```r
Install a previously released version (e.g. v1.0.0) from GitHub
devtools::install_github("USEPA/useeior@v1.0.0") ```
See Releases for all previously released versions.
Usage
Build Model
View all models with existing config files that can be built using useeior
r
library("useeior")
seeAvailableModels()
Build a model that is available in useeior (e.g. the USEEIOv2.0.1-411 model)
r
model <- buildModel('USEEIOv2.0.1-411')
To build a customized model, refer to Advanced Uses in Wiki.
This generates a complete USEEIO model with components described in the Model table.
Adjust Price Year and Type of Model Results
Adjust model results (e.g. N matrix) to user-specified price year (e.g. 2018) and type (producer's or purchaser's).
r
N_adj <- adjustResultMatrixPrice("N",
currency_year = 2018,
purchaser_price = TRUE,
model)
Calculate Model LCI and LCIA
Calculate model life cycle inventory (LCI) and life cycle impact assessment (LCIA) results with a user-specified calculation perspective, demand vector (from DemandVectors in the model object, which includes four default vectors, or a user-provided vector) and a model direct requirements matrix.
r
result <- calculateEEIOModel(model,
perspective = "DIRECT",
demand = "CompleteProduction",
use_domestic_requirements = FALSE)
This returns a Calculation Result.
Write Model to File
Write selected model matrices, demand vectors, and metadata as one .xlsx file to a given output folder.
r
writeModeltoXLSX(model, outputfolder)
Write model matrices as .csv files to a given output folder.
r
writeModelMatrices(model, to_format = "csv", outputfolder)
Validate Model
Complete model validation checks can be found in ValidateModel.Rmd.
Knit ValidateModel_render.Rmd to perform all validation checks on selected models (specified under the YAML header).
This will generate an .html and a .md file containing validation results for each model. See example output in inst/doc/output/.
Examples
Validate that flow totals by commodity E_c can be recalculated (within 1%) using the model satellite matrix B, market shares matrix V_n, total requirements matrix L, and demand vector y for US production.
```r
modelval <- compareEandLCIResult(model, tolerance = 0.01) print(paste("Number of flow totals by commodity passing:", modelval$NPass)) [1] "Number of flow totals by commodity passing: 1118742" print(paste("Number of flow totals by commodity failing:", modelval$NFail)) [1] "Number of flow totals by commodity failing: 0" ```
Validate that commodity output can be recalculated (within 1%) with the model total requirements matrix L and demand vector y for US production.
```r
econval <- compareOutputandLeontiefXDemand(model, tolerance = 0.01) print(paste("Number of sectors passing:",econval$NPass)) [1] "Number of sectors passing: 409" print(paste("Number of sectors failing:",econval$NFail)) [1] "Number of sectors failing: 2" print(paste("Sectors failing:", paste(econval$Failure$rownames, collapse = ", "))) [1] "Sectors failing: S00402/US, S00300/US" ``
Note:S00402/US - Used and secondhand goodsandS00300/US - Noncomparable importsare two commodities that are not produced by any industry in the US, therefore their commodity output naturally cannot be recalculated with the model total requirements matrixLand demand vectory` for US production. Results for these sectors are not recommended for use.
Visualize Model Results
Examples
Rank sectors based a composite score of selected total impacts (Hr or Hl) associated with total US demand (US production or consumption vector). Comparing rankings may also be used as another form of model validation that incorporates the demand vectors and the indicators as well as the model result matrices.
```r
Calculate model LCIAd (Hr) and LCIAf (Hl)
result <- c(calculateEEIOModel(model, perspective = 'DIRECT', demand = "Production"), calculateEEIOModel(model, perspective = 'FINAL', demand = "Consumption")) colnames(result$Hr) <- model$Indicators$meta[match(colnames(result$Hr), model$Indicators$meta$Name), "Code"] colnames(result$Hl) <- colnames(result$Hr)
Define indicators
indicators <- c("ACID", "CCDD", "CMSW", "CRHW", "ENRG", "ETOX", "EUTR", "GHG", "HRSP", "HTOX", "LAND", "MNRL", "OZON", "SMOG", "WATR")
Create figure on the left
heatmapSectorRanking(model, matrix = result$Hr, indicators, sectortoremove = "", Nsector = 20, xtitle = "Hr (DIRECT perspective) & US production demand")
Create figure on the right
heatmapSectorRanking(model, matrix = result$Hl, indicators, sectortoremove = "", Nsector = 20, xtitle = "Hl (FINAL perspective) & US consumption demand") ```

More visualization examples are available in Example.Rmd.
Analyze Flow and Sector Contribution to Impact
Examples
Analyze flow contribution to total (direct+indirect) Acidification Potential in the Electricity sector (221100/US), showing top 5 contributors below.
```r
ACIDelec <- calculateFlowContributiontoImpact(model, "221100/US", "Acidification Potential") ACIDelec$contribution <- scales::percent(ACIDelec$contribution, accuracy = 0.1) head(subset(ACIDelec, TRUE, select = "contribution"), 5) contribution "Sulfur dioxide/emission/air/kg" 57.4% "Nitrogen dioxide/emission/air/kg" 39.2% "Ammonia/emission/air/kg" 2.3% "Sulfuric acid/emission/air/kg" 0.7% "Hydrofluoric acid/emission/air/kg" 0.2% ```
Analyze sector contribution to total (direct+indirect) Human Health - Respiratory Effects in the Flours and malts sector (311210/US), showing top 5 contributors below.
```r
HHRPflour <- calculateSectorContributiontoImpact(model, "311210/US", "Human Health - Respiratory Effects") HHRPflour$contribution <- scales::percent(HHRPflour$contribution, accuracy = 0.1) head(subset(HHRPflour, TRUE, select = "contribution"), 5) contribution "1111B0/US - Fresh wheat, corn, rice, and other grains" 90.7% "311210/US - Flours and malts" 1.5% "115000/US - Agriculture and forestry support" 0.9% "2123A0/US - Sand, gravel, clay, phosphate, other nonmetallic minerals" 0.8% "1111A0/US - Fresh soybeans, canola, flaxseeds, and other oilseeds" 0.8% ```
More analysis examples are available in Example.Rmd.
Compare Model Results
Comparison betwen two models can be found in CompareModel.Rmd.
Knit CompareModel_render.Rmd to perform comparison on selected models (specified under the YAML header).
This will return an .html and a .md file containing comparison results for each model specified in the header. An example can be found inst/doc/output/
Currently, it only compares flow totals between two models. More comparisons will be added in the future.
Additional Information
A complete list of available functions for calculating, validating, exporting and visualizing model can be found here in the Wiki.
Disclaimer
The United States Environmental Protection Agency (EPA) GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity , confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government.
Owner
- Name: U.S. Environmental Protection Agency
- Login: USEPA
- Kind: organization
- Location: United States of America
- Website: https://www.epa.gov
- Twitter: EPA
- Repositories: 449
- Profile: https://github.com/USEPA
GitHub Events
Total
- Create event: 19
- Release event: 4
- Issues event: 21
- Watch event: 4
- Delete event: 16
- Member event: 1
- Issue comment event: 11
- Push event: 83
- Pull request review comment event: 2
- Pull request review event: 9
- Pull request event: 28
- Fork event: 9
Last Year
- Create event: 19
- Release event: 4
- Issues event: 21
- Watch event: 4
- Delete event: 16
- Member event: 1
- Issue comment event: 11
- Push event: 83
- Pull request review comment event: 2
- Pull request review event: 9
- Pull request event: 28
- Fork event: 9
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| MoLi7 | m****i@g****m | 851 |
| Ben Young | B****g@e****m | 757 |
| WesIngwersen | i****y@e****v | 391 |
| jvendries | j****s@h****m | 218 |
| jvendries | j****s@h****l | 144 |
| catherinebirney | 6****y | 47 |
| cga203 | 6****3 | 26 |
| Andrew Beck | 8****k | 26 |
| GitHub Actions Bot | 4****] | 13 |
| Mo Li | l****7@u****u | 11 |
| Julie Chen | j****n@e****m | 4 |
| datascape | h****s@d****m | 4 |
| dannyhage | 6****e | 3 |
| Elon Cha | 5****a | 3 |
| dyoung11 | y****l@e****v | 2 |
| Quentin Read | q****d@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 140
- Total pull requests: 199
- Average time to close issues: about 2 months
- Average time to close pull requests: 13 days
- Total issue authors: 16
- Total pull request authors: 12
- Average comments per issue: 2.21
- Average comments per pull request: 2.06
- Merged pull requests: 184
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 12
- Pull requests: 23
- Average time to close issues: 22 days
- Average time to close pull requests: 22 days
- Issue authors: 6
- Pull request authors: 3
- Average comments per issue: 0.17
- Average comments per pull request: 1.0
- Merged pull requests: 22
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- WesIngwersen (77)
- bl-young (28)
- MoLi7 (20)
- TheTisiboth (3)
- catherinebirney (2)
- robinsonkwame (2)
- cga203 (1)
- jvendries (1)
- fchichorro (1)
- yyandgin (1)
- konstantinstadler (1)
- msrocka (1)
- rlieberthal (1)
- hscottmatthews (1)
- qdread (1)
Pull Request Authors
- bl-young (111)
- MoLi7 (51)
- WesIngwersen (40)
- jvendries (15)
- modelearth (2)
- fchichorro (2)
- ModelEarth (2)
- dannyhage (2)
- a-w-beck (1)
- jprf1984 (1)
- StateData (1)
- qdread (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v2 composite
- actions/upload-artifact main 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
- JasonEtco/create-an-issue v2.6.0 composite
- actions/checkout v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- r-lib/actions/setup-r-dependencies v1 composite
- r-lib/actions/setup-renv v2 composite
- R >= 3.6 depends
- arrow >= 2.0.0 imports
- configr >= 0.3.4 imports
- digest >= 0.6.27 imports
- dplyr >= 1.0.6 imports
- ggplot2 >= 3.0 imports
- jsonlite >= 1.6 imports
- logging >= 0.10 imports
- rappdirs >= 0.3 imports
- readxl >= 1.3.1 imports
- reshape2 >= 1.4.3 imports
- reticulate >= 1.1 imports
- rlang >= 0.4.11 imports
- scales >= 1.1.1 imports
- stats >= 3.6.1 imports
- stringr >= 1.4 imports
- tibble >= 2.1.3 imports
- utils >= 3.6.1 imports
- writexl >= 1.2 imports
- testthat >= 3.0.0 suggests
- actions/checkout v3 composite
- actions/upload-artifact v3.1.1 composite
- actions/upload-artifact main 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-renv v2 composite
- actions/checkout v3 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-renv v2 composite