Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.6.1 #325

Merged
merged 313 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
313 commits
Select commit Hold shift + click to select a range
79f880e
move calculate and validateImportA from IOfunctions.R to ValidateMOde…
Oct 31, 2023
bfd845f
Added temporary comment in IOFunctions.R
Oct 31, 2023
696af76
Removed imports from the calculation of y_m in the prepareIMportedPro…
Oct 31, 2023
c9690bc
Removed imports from y_m_p returned by prepareIMportedProductionDeman…
Oct 31, 2023
0988586
Modified caculateAndValidateImportA so it could be called outside of …
Oct 31, 2023
efd0dd4
Modified
Oct 31, 2023
83efd3f
In buildModelwithImportFactors function,
Nov 10, 2023
e98ac12
add temporary ImportMatrix object to model object
Nov 11, 2023
407f08e
update GHG parquets, add state model spec
bl-young Nov 15, 2023
1af3d6d
cleanup
bl-young Nov 15, 2023
18e0638
initial updates for import factors for two-region models
bl-young Nov 15, 2023
c94214a
Added loadImportMatrix function to add the ImportMatrix to the model …
Nov 15, 2023
4d5a7fa
fix model name in action
bl-young Nov 16, 2023
ad90e65
fix label in action
bl-young Nov 16, 2023
634b1b3
cleanup and update documentation
bl-young Nov 16, 2023
2dfda81
pass import table instead of attaching to model
bl-young Nov 16, 2023
7d859a3
update definition of import final demand
Nov 16, 2023
dd6ac8f
update prepreIMportedProductionDemand function to match changes to mo…
Nov 16, 2023
c5ce5b3
remove commented code
Nov 16, 2023
612f925
add validateImportFactorsApproach function
Nov 16, 2023
38ed94b
remove calculateAndValidateImportA function
Nov 16, 2023
65e1a24
drop model$M from import factors model as it is not representative of…
bl-young Nov 17, 2023
5e80350
use `prepareImportedProductionDemand()` function in validation for co…
bl-young Nov 17, 2023
42862b9
create N for both model types
bl-young Nov 17, 2023
041d4cf
cleanup
bl-young Nov 17, 2023
14f11ff
drop getFinalDemandCodes, not a useeior function
bl-young Nov 17, 2023
147a606
validate model in action
bl-young Nov 17, 2023
740c0af
add logging message
bl-young Nov 17, 2023
a720261
update documentation
bl-young Nov 17, 2023
7dfdeaa
Add prepareImportConsumptionDemand function
Nov 17, 2023
f723333
add consumption demand vector option for import factors
Nov 17, 2023
541ff85
For models with external import factors,
Nov 17, 2023
f9243d3
In calculateResultsWithExternalFactors function, added warning regard…
Nov 17, 2023
2c72492
Change validateImportFactorsApproach function to use Consumption fina…
Nov 17, 2023
9010008
Add LCIA calculation to models with external import factors
Nov 17, 2023
c8ca169
Add validation of LCIA results for models with external import factors
Nov 17, 2023
ba3f7eb
start of code for adding import demand vectors during loadDemandVecto…
Nov 20, 2023
625e6d1
rename `prepareImportedProductionDemand()` -> `prepareImportProductio…
bl-young Nov 20, 2023
e85f7de
fix missing docs
bl-young Nov 20, 2023
442dbea
fix documentation
bl-young Nov 20, 2023
59ab764
new helper function to prepare demand vector for imports
bl-young Nov 20, 2023
d472dcd
Merge branch 'linkstateiorImportF' of https://github.com/USEPA/useeio…
Nov 20, 2023
9ccbfb2
Edit descriptive comments in buildModelwithImportFactors function
Nov 24, 2023
e6c8c55
Add comment to model$N_m calculation (line 140 in constructEEIOMatrices)
Nov 24, 2023
dd0a954
search through directory for all configpaths for external files, dupl…
bl-young Dec 2, 2023
5fdcb69
pass configpaths through to LoadExternalImportFactors to enable exter…
bl-young Dec 2, 2023
74118a1
drop extdata from importfactors spec
bl-young Dec 2, 2023
6bee512
return only domestic portion of result for import calculations with p…
bl-young Dec 4, 2023
d7474cb
allow import factors to be souced from data commons
bl-young Dec 20, 2023
5ea9ed2
update model name for 2region w/ import factors
bl-young Jan 4, 2024
7f07377
move calculation of `ImportFinalDemand` to DemandFunctions
bl-young Jan 4, 2024
29bc93a
pass location for two region models for demand vector
bl-young Jan 4, 2024
ff99b62
adjust stop error message for clarity
bl-young Jan 4, 2024
f7a5e73
pass location to demand vector calc
bl-young Jan 4, 2024
2a4bd55
turn on existing demand calcs for 2r models
bl-young Jan 4, 2024
d89737d
run validation for 2r models; pass location
bl-young Jan 4, 2024
2706f29
Change nomenclature in model from M_m to Q_t to align with nomenclatu…
Jan 4, 2024
0feb975
Update comment in validateImportFactorsApproch
Jan 5, 2024
57a6e68
add households to CbS based on final demand totals; cast those coeffi…
bl-young Jan 6, 2024
4a54d6b
add row to results matrix for households when `household_emissions = …
bl-young Jan 6, 2024
5be39df
assign household demand codes dynamically for result calc
bl-young Jan 8, 2024
d6cc8f2
pass location to calculateStandardResults to allow selecting househol…
bl-young Jan 8, 2024
83c9456
select region for two-region models
bl-young Jan 8, 2024
4f47133
reorder B_h to match demand cols
bl-young Jan 8, 2024
7fd9b0e
add households to color schema
bl-young Jan 8, 2024
df8b9d3
Merge branch 'release-v1.4.0' into household_efs
bl-young Jan 8, 2024
5197e0b
update documentation
bl-young Jan 8, 2024
37d0313
Merge branch 'release-v1.4.0' into linkstateiorImportF
bl-young Jan 8, 2024
6304486
add household emissions to calculation with import factors
bl-young Jan 8, 2024
7c2ed04
Merge branch 'linkstateiorImportF' into imports_2region
bl-young Jan 12, 2024
b6e0335
Remove model$N_m object from model. To calculate this properly I beli…
Jan 12, 2024
d4efeb4
Merge branch 'linkstateiorImportF' of https://github.com/USEPA/useeio…
Jan 12, 2024
d7e6d01
test demand vector for import consumption in 2r model
bl-young Jan 12, 2024
2465247
Add model objects specific to the coupled model approach to format sp…
Jan 12, 2024
7d03f35
added 2r GA model without import factors for testing purposes
Jan 12, 2024
910aaf5
removed ImportFinalDemand from format specs as this will be removed o…
Jan 12, 2024
7c9cd32
removed reference to model$FinalDemand so that prepare2RDemand can be…
Jan 12, 2024
c7fef1a
fix variable name to match return statement
Jan 12, 2024
a9ba2ea
temporary code for testing validation of 2R models with IF for produc…
Jan 13, 2024
7f8fd5b
add model objects M and N back to model specs
jvendries Jan 13, 2024
29e67d2
Merge pull request #271 from USEPA/imports_2region
bl-young Jan 15, 2024
874a828
Merge branch 'linkstateiorImportF' into household_efs
bl-young Jan 15, 2024
26be867
Merge pull request #270 from USEPA/household_efs
bl-young Jan 15, 2024
38dc174
limit region for householde emissions for 2r model; fix result name a…
bl-young Jan 15, 2024
807b879
Add stop conditions for calculating/validation 2R models for producti…
Jan 18, 2024
1f94022
Add perspective as a paramter to the calculateResultsWithExternalFact…
Jan 24, 2024
9c3776a
Added direct perspective calculation for IF models based on the follo…
Jan 24, 2024
bfa259c
add household emisssions to direct perspective calculation for IF models
Jan 24, 2024
ad947c4
Changed demand term in the implementation of direct perspective resul…
Jan 24, 2024
5ab2548
Adjust direct perspective calculation based on suggestion in this com…
Jan 27, 2024
f1b1362
use industries from model to avoid errors for disaggregated models
bl-young Feb 7, 2024
5eea7a4
increase tolerance for disaggregated state models
bl-young Feb 7, 2024
63ab800
add sample disaggregated 2r model spec
bl-young Feb 7, 2024
3f7ba02
update docs
bl-young Feb 7, 2024
1479582
add two region disaggregated model to testing
bl-young Feb 7, 2024
7a5ee53
update PrintValidationResults to print validation results for compare…
Feb 16, 2024
9e06bda
Add alternate direct perspective calculation as comments
Feb 16, 2024
eeef9df
turn back on colors for Used and Other
bl-young Feb 26, 2024
2b75069
update docs
bl-young Feb 26, 2024
9d8f094
fix error in unnamed lcia results for households
bl-young Feb 26, 2024
62147b6
fix typos in action
bl-young Feb 29, 2024
825546f
Merge branch 'linkstateiorImportF' into 2r_disagg
bl-young Feb 29, 2024
480278e
fix typo
bl-young Feb 29, 2024
9ddcf25
v0.3.0 stateio tables not yet available on data commons so action won…
bl-young Feb 29, 2024
eb6c433
Merge branch 'linkstateiorImportF' of https://github.com/USEPA/useeio…
Feb 29, 2024
00e9142
Call print2RValidationResults from printValidationResults rather than…
Feb 29, 2024
1703d2e
consolidate validation steps
bl-young Feb 29, 2024
4b8f119
move disaggregation specs from stateior to useeior
bl-young Feb 29, 2024
208c008
Merge pull request #277 from USEPA/2r_disagg
bl-young Feb 29, 2024
b1c36ed
rename import factors module
bl-young Feb 29, 2024
132fcff
move buildModelwithImportFactors()
bl-young Feb 29, 2024
1be6202
Merge branch 'linkstateiorImportF' of https://github.com/USEPA/useeio…
Mar 4, 2024
582e210
fix error in grabbing index leading to warning message
bl-young Mar 8, 2024
a3f2256
allow built in demands for import results
bl-young Mar 8, 2024
d7ebfc0
characterize CO2e flows resolves #281
bl-young Mar 12, 2024
c5e2752
adjust calculation of $B_h$ to be based on total consumption instead …
bl-young Mar 14, 2024
4f4ab3a
fix error in assigning household codes for different model types
bl-young Mar 14, 2024
a08c2b1
fix error in two region models for household emissions
bl-young Mar 14, 2024
3e0b8b3
add function to validateHouseholdEmissions
bl-young Mar 14, 2024
8baf735
avoid errors for models with no household emissions in any satellite …
bl-young Mar 14, 2024
5712510
fix error in bool
bl-young Mar 15, 2024
07fa0e1
Merge branch 'develop' into linkstateiorImportF
bl-young Apr 8, 2024
ebf7c34
move new summary models w/ import factors to tests; consolidate model…
bl-young Apr 8, 2024
19666e2
simplify reading of import factors
bl-young Apr 8, 2024
48da7f2
Supply tables only available with 2017 schema
bl-young Apr 8, 2024
e23856e
incorporate utility disaggregation into two region model testing
bl-young Apr 8, 2024
0ae8af0
Merge branch 'develop' into linkstateiorImportF
bl-young Apr 8, 2024
b51a684
revert 48da7f2b following #286
bl-young Apr 8, 2024
4dd238b
fix error for when `ExternalImportFactors` is FALSE
bl-young Apr 8, 2024
fe67753
move testing import multipliers file to within tests folder
bl-young Apr 8, 2024
bc7770e
:construction: summary disaggregation can still cause errors, set yea…
bl-young Apr 8, 2024
1cd0d77
use file in tests, align with fe67753
bl-young Apr 8, 2024
f9c761f
:construction: stateio disaggregation files not yet available, turn o…
bl-young Apr 8, 2024
0c4b402
add createDisaggFilesFromProxyData function to useeior
Apr 25, 2024
4457453
add model build tests for 2R model with "standard" utilities disaggre…
Apr 25, 2024
1cec7e0
add utilitydisaggbyproxy yml file
Apr 25, 2024
5a7109f
add GAEEIO yml files for 2R utility disagg (standard and by proxy)
Apr 25, 2024
56c09c9
add employment ratios csv file required for disaggbyproxy
Apr 25, 2024
205e7eb
remove temporary variaables
Apr 26, 2024
3552852
Add code to format disaggSpecs object for disaggregating 2R models th…
Apr 26, 2024
57e4330
consolidate EmissionYear and CurrencyYear in import factors, only use…
bl-young May 1, 2024
dd9da17
split out `loadExternalImportFactors` into more functions for easier …
bl-young May 2, 2024
c98a995
pull two-region disaggregation files to move to new branch
bl-young May 7, 2024
569e787
update documentation files
bl-young May 7, 2024
05cb080
update structure and rename the test import factors file
bl-young May 7, 2024
345dedc
fix documentation
bl-young May 7, 2024
3f18d04
fix error in handling of #281 which can cause other flows to be assig…
bl-young May 9, 2024
835f36e
remove unneeded comments
May 10, 2024
9f96eab
Add "not yet implemented" warning for 2R region models with utilities…
May 14, 2024
8766a25
changed warning to stop for 2R models with utilities disagg
May 15, 2024
a77a3f2
add missing print statement in IF validation
May 15, 2024
2e3eb24
add stop for createDisaggFilesFromProxyData function as this is for 2…
May 15, 2024
9a4cde0
remove margins tables for two region models #290
bl-young May 16, 2024
210b1cf
change model spec from 3.0 to 2.2
bl-young May 16, 2024
dde2d8f
can't construct Phi if no margins, #290
bl-young May 16, 2024
41bd541
include writing model to excel in some tests
bl-young May 16, 2024
d2e3c85
cleanup spacing and line length
bl-young May 16, 2024
eee9807
Merge pull request #288 from USEPA/linkstateiorImportF
bl-young May 16, 2024
3a255cd
skip writing flows for economic models, #291
bl-young May 17, 2024
9fdce17
skip some validations for economic only models; add economic models t…
bl-young May 17, 2024
98b848b
rename `buildEIOModel` to `buildIOModel` and export; incorporate adju…
bl-young May 17, 2024
9eeb772
Merge branch 'issue_291' into develop
bl-young May 17, 2024
9942859
consolidate common code for economic and price adjustment matrices to…
bl-young May 17, 2024
f6999b7
tighten tolerance for flow loss and change to warning
bl-young May 29, 2024
f2b63b5
create allocation factors based on NAICS and location, resolves #296
bl-young May 29, 2024
efe1235
update documentation
bl-young May 29, 2024
3b2f8a0
Merge pull request #297 from USEPA/issue_296
bl-young May 29, 2024
2b5ad5b
add household emissions value for 2nd region if applicable
bl-young Jun 6, 2024
429ebfb
move household emission calculations to a new function `CalculateHous…
bl-young Jun 6, 2024
d188633
Remove export residual from 2R consumption vector
Jun 13, 2024
57a3362
fix typo in comment
Jun 14, 2024
e740d88
fix error in assigning factors to CO2e flows #281
bl-young Jun 14, 2024
4961d7f
Merge branch 'master' into develop
bl-young Jun 14, 2024
94c5db2
Add 2R models with and without export residuals in consumption vector
Jun 14, 2024
50fa6e0
Add .rmd script testing impacts of commit d1886338
Jun 14, 2024
5e7102d
rename script to issue_298
Jun 17, 2024
654b8c6
delete issue 298 script and model objects (moved to USEEIO_team)
Jun 17, 2024
cb17b9c
removed unnecessary comments
Jun 17, 2024
544f091
Merge pull request #300 from USEPA/issue_298
WesIngwersen Jun 17, 2024
79d1db2
add agg_metasources parameter to enable access to TbS while maintaini…
bl-young Jun 19, 2024
f0395a3
fix typo
bl-young Jun 23, 2024
965b7c8
calculate import calculations as separate vectors; use direct perspec…
bl-young Jul 8, 2024
c575d97
update direct calculation of term 2 to diagonalize A_m * L_d * y_d pr…
bl-young Jul 9, 2024
b3c71bd
transpose all results
bl-young Jul 9, 2024
1af22c7
update test model to latest published GHG FBS
bl-young Jul 27, 2024
02fb069
Fix capitalization
bl-young Jul 30, 2024
8f85ada
Merge pull request #301 from USEPA/import_calcs
bl-young Aug 1, 2024
e1076d9
replace `Q_t` with `M_m`, #303
bl-young Aug 1, 2024
2181b12
add `M_m` and `N_m` for writing to Excel
bl-young Aug 1, 2024
556ec51
add USEEIOv2.3 model specs
bl-young Aug 1, 2024
f7cdf83
add `N_m` to model build
bl-young Aug 1, 2024
6e54eed
rearrange testing to fix error
bl-young Aug 1, 2024
2083c70
fix typo
bl-young Aug 1, 2024
89fd49e
update pointer for testing two-region import factors
bl-young Aug 1, 2024
798f003
new function `castImportFactors` based on `standardizeandcastSatellit…
bl-young Aug 1, 2024
c01833c
fix typo
bl-young Aug 1, 2024
21bd483
Merge branch 'master' into develop
bl-young Aug 2, 2024
d24d37c
:bookmark: bump to v1.6.0
bl-young Aug 2, 2024
f6bf6f9
Add L_m to model.md and tweak other *_m matrix descriptions
WesIngwersen Aug 2, 2024
7cd8023
add `A_m` for writing to excel
bl-young Aug 2, 2024
0ead446
Replace L_m with A_m in Model.md; add ImportMatrix
WesIngwersen Aug 2, 2024
bc57e30
Merge branch 'release_v1.6.0' of https://github.com/USEPA/useeior int…
WesIngwersen Aug 2, 2024
e3af31b
fix data year in model spec metadata for GHG data for new v2.3 models
WesIngwersen Aug 2, 2024
6fc92a8
do not export calculateStandardResults
WesIngwersen Aug 6, 2024
e192218
Do not export compare2RVectorTotals()
WesIngwersen Aug 6, 2024
a7ae434
Remove export of compareCommodityOutputXMarketShareandIndustryOutputw…
WesIngwersen Aug 6, 2024
e92d242
do not export aggregateResultMatrixbyRow()
WesIngwersen Aug 6, 2024
ee7f08d
do not export calculateHouseholdEmissions
WesIngwersen Aug 6, 2024
97a5e5e
Do not export calculateResultsWithExternalFactors()
WesIngwersen Aug 6, 2024
62850be
Update date for release, drop ML from authors
WesIngwersen Aug 6, 2024
efaed73
Merge pull request #306 from USEPA/release_v1.6.0
WesIngwersen Aug 6, 2024
876817a
update roxygen produced docs
WesIngwersen Aug 6, 2024
636a81b
Merge pull request #308 from USEPA/release_v1.6.0
WesIngwersen Aug 6, 2024
9d6a995
implement RoW portion of results matrix for single region model
bl-young Aug 15, 2024
8582c81
incorporate RoW for result matrix in two region models
bl-young Aug 15, 2024
455b406
Add show_RoW param to calculateEEIOModel and propogate through calcul…
WesIngwersen Aug 16, 2024
f9f1ab4
should be rbind because in d the results are transposed
WesIngwersen Aug 16, 2024
336cc55
udpate documentation
bl-young Aug 16, 2024
07998ce
avoid extra rows if location is set for single region model
bl-young Aug 16, 2024
ed279a0
add clarity to matrix subsetting
bl-young Aug 16, 2024
7ffeca3
refactor results calculation to reduce duplication #312
bl-young Aug 16, 2024
27ad877
move household emissions calc to end
bl-young Aug 16, 2024
9b7e2cd
add row for RoW to household emissions result #312
bl-young Aug 16, 2024
98410e5
Merge pull request #314 from USEPA/row_results
bl-young Aug 19, 2024
5cc4f0e
move `prepareDemandVectorforStandardResults()` inside `calculateStand…
bl-young Sep 4, 2024
f938989
drop `-s` from two region model name
bl-young Sep 4, 2024
a35b2c7
derive an M matrix for IEF models #311
bl-young Sep 4, 2024
6ddc6b4
drop export of validation functions #307
bl-young Sep 4, 2024
119ea9c
use domestic production demand and import consumption demand to creat…
bl-young Sep 10, 2024
04b7a8e
revise approach for deriving M to use q and y_m
bl-young Sep 10, 2024
7c7f855
derive m from use table
bl-young Sep 10, 2024
adb2daf
fix error in deriving M matrix for 2R models
bl-young Sep 10, 2024
b80c38b
ignore location when removing imports
bl-young Sep 10, 2024
462eb53
use IEFs from 2012 schema in testing 2R model
bl-young Sep 11, 2024
c9762f4
validate that M is between M_m and M_d
bl-young Sep 11, 2024
e232ca1
move M matrix test to validation and print any failures
bl-young Sep 13, 2024
9cfe575
fix typos
bl-young Sep 14, 2024
0910392
Merge branch 'develop' into issue_311
bl-young Oct 30, 2024
4ace170
Merge pull request #317 from USEPA/issue_311
bl-young Oct 30, 2024
e9256a8
move two region model spec (v1.0) out of tests
bl-young Oct 31, 2024
5c5c18e
include additional warnings for functions that don't work for specifi…
bl-young Oct 31, 2024
bea22ec
adds result and visualization tests to a number of models, #320
bl-young Oct 31, 2024
87a0d0b
export validation functions
bl-young Oct 31, 2024
13d78eb
warnings not converted to errors
bl-young Oct 31, 2024
031e992
Revert "derive an M matrix for IEF models"
WesIngwersen Nov 1, 2024
1d88467
Merge pull request #323 from USEPA/revert-317-issue_311
bl-young Nov 1, 2024
70ea6d4
add new calculation for M matrix with IEFs, #311
bl-young Nov 1, 2024
28254f6
Merge pull request #324 from USEPA/M_withIEFs
bl-young Nov 1, 2024
637a78d
Merge pull request #321 from USEPA/issue_320
bl-young Nov 4, 2024
13854b4
:bookmark: bump to v1.6.1
bl-young Nov 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
config:
# - {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
#- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ work
inst/doc/**/*.html
renv/
examples
tests/*.xlsx
7 changes: 3 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
Package: useeior
Type: Package
Title: USEEIO R modeling software
Version: 1.5.3
Date: 2024-7-13
Version: 1.6.1
Date: 2024-11-4
Authors@R: c(
person("Ben","Young", email="[email protected]", role="aut"),
person("Jorge","Vendries", email="[email protected]", role="aut"),
person("Mo","Li", email="[email protected]", role="aut"),
person("Wesley","Ingwersen", email="[email protected]", role= c("aut", "cre")))
Description: The United States Environmentally-Extended Input-Output model
is a model used to estimate potential environmental and economic impacts
Expand Down Expand Up @@ -41,7 +40,7 @@ License: file LICENSE
Encoding: UTF-8
LazyData: true
LazyDataCompression: xz
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
12 changes: 3 additions & 9 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@

export(adjustResultMatrixPrice)
export(aggregateResultMatrix)
export(aggregateResultMatrixbyRow)
export(barplotFloworImpactFractionbyRegion)
export(barplotIndicatorScoresbySector)
export(buildIOModel)
export(buildModel)
export(buildTwoRegionModels)
export(calculateEEIOModel)
export(calculateFlowContributiontoImpact)
export(calculateMarginSectorImpacts)
export(calculateSectorContributiontoImpact)
export(calculateSectorPurchasedbySectorSourcedImpact)
export(compare2RCommodityTotals)
export(compareCommodityOutputXMarketShareandIndustryOutputwithCPITransformation)
export(compareCommodityOutputandDomesticUseplusProductionDemand)
export(compareEandLCIResult)
export(compareFlowTotals)
export(compareOutputandLeontiefXDemand)
export(disaggregateTotalToDirectAndTier1)
export(extractAndFormatDemandVector)
export(formatDemandVector)
Expand All @@ -26,10 +20,10 @@ export(heatmapSatelliteTableCoverage)
export(heatmapSectorRanking)
export(normalizeResultMatrixByTotalImpacts)
export(plotMatrixCoefficient)
export(print2RValidationResults)
export(printValidationResults)
export(seeAvailableModels)
export(validate2RCommodityTotals)
export(testCalculationFunctions)
export(testVisualizationFunctions)
export(writeModelMatrices)
export(writeModelforAPI)
export(writeModeltoXLSX)
Expand Down
8 changes: 6 additions & 2 deletions R/AdjustPrice.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ adjustResultMatrixPrice <- function(matrix_name, currency_year, purchaser_price=
}
# Adjust price type of multiplier
if (purchaser_price) {
logging::loginfo(paste("Adjusting", matrix_name, "matrix from producer to purchaser price..."))
mat <- adjustMultiplierPriceType(mat, currency_year, model)
if(is.null(model$Phi)) {
logging::logwarn("Model does not contain margins, purchaser price can not be calculated")
} else {
logging::loginfo(paste("Adjusting", matrix_name, "matrix from producer to purchaser price..."))
mat <- adjustMultiplierPriceType(mat, currency_year, model)
}
} else {
logging::loginfo(paste("Keeping", matrix_name, "matrix in producer price..."))
}
Expand Down
Loading
Loading