Skip to content

Commit

Permalink
Update example - remove writeModelforAPI, replace old fxn names with …
Browse files Browse the repository at this point in the history
…new names
  • Loading branch information
WesIngwersen committed Mar 23, 2021
1 parent 53b123e commit a9972b0
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions examples/USEEIO20.R
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)

0 comments on commit a9972b0

Please sign in to comment.