forked from USEPA/useeior
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update example - remove writeModelforAPI, replace old fxn names with …
…new names
- Loading branch information
1 parent
53b123e
commit a9972b0
Showing
1 changed file
with
8 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
# Example for running useeior, see https://github.com/USEPA/useeior for more information on the model | ||
# Must install useeior first to run example. See Wiki @ https://github.com/USEPA/useeior/Wiki for install instructions | ||
# Run ?functionname to see documentation and function input options for the functions in this example | ||
|
||
|
||
library(useeior) | ||
|
||
# See all available model names | ||
# explanation of model names can be found at https://github.com/USEPA/USEEIO/blob/master/VersioningScheme.md | ||
useeior::seeAvailableModels() | ||
seeAvailableModels() | ||
|
||
# Build an EEIO model | ||
# Build USEEIO v2.0 | ||
model <- buildModel("USEEIOv2.0") | ||
|
||
# Calculate direct perspective LCI and LCIA | ||
result <- useeior::calculateEEIOModel(model, perspective = "DIRECT", demand = "Consumption") | ||
|
||
# Adjust N matrix (total environmental impacts per dollar) to 2018 dollar and purchaser price | ||
adjusted_result <- adjustMultiplierPrice("N", currency_year = 2018, purchaser_price = TRUE, model) | ||
|
||
# Write model for API | ||
useeior::writeModelforAPI(model,"../useeio_api/") | ||
# Calculate direct perspective life cycle inventory (LCI) result and life cycle impact assessment (LCIA) | ||
# result using total US production | ||
result <- calculateEEIOModel(model, perspective = "DIRECT", demand = "Production") | ||
|
||
# Adjust N matrix (direct + indirect impacts per dollar) to 2018 dollar and purchaser price | ||
N_adj <- adjustResultMatrixPrice("N", currency_year = 2012, purchaser_price = FALSE, model) | ||
|