Recent Releases of recca
recca - v0.1.62
Recca 0.1.62 (2025-08-03)
write_ecc_to_excel()now allows writing worksheets into pre-existing files. New boolean argumentoverwrite_worksheetscontrols whether existing worksheets can be overwritten.- New tests for new features.
- Now up to 898 tests, all passing.
- Test coverage remains at 100%.
- R
Published by MatthewHeun 7 months ago
recca - v0.1.61
Recca 0.1.61 (2025-07-25)
reallocate_statistical_differences()is now robust to ECCs with no Statistical differences, with Statistical differences in only R, and with Statistical differences in only Y.- Move
reallocate_statistical_differences()and its tests fromIEAToolstoRecca. The purpose ofIEAToolsis to move from the IEA format to the PSUT format. The purpose ofReccais to manipulate data already in the PSUT format.reallocate_statistical_differences()requires data in the PSUT format and thereforereallocate_statistical_differences()is better suited toRecca. write_ecc_to_excel()now completes the U and V matrices relative to each other on both margins, thereby enabling easier energy balance checks via (iR)^T^ + (iV)^T^ - Ui - y = 0.
- R
Published by MatthewHeun 7 months ago
recca - v0.1.60
Recca 0.1.60 (2025-07-06)
- New function
add_row_col_types()adds row and column types to matrices based on default matrix names and structure of the PSUT framework. First use is insideread_ecc_from_excel(). - New function
read_ecc_from_excel()serves as the inverse ofwrite_ecc_to_excel(), taking advantage of named regions in Excel spreadsheets. Both functions now name regions as<<matrix name>>__<<worksheet name>>by default. - New tests for new features.
- Now up to 852 tests, all passing.
- Test coverage remains at 100%.
- R
Published by MatthewHeun 8 months ago
recca - v0.1.58
Recca 0.1.58 (2025-06-27)
- New argument
worksheet_namesonwrite_ecc_to_excel()enables setting worksheet names in the resulting Excel file. - Now claiming dependence on R >= 4.1.0 due to use of the new pipe.
write_ecc_to_excel()now adds a region name for each matrix in the Excel sheet.- New tests for new features.
- Now up to 780 tests, all passing.
- Test coverage remains at 100%.
- R
Published by MatthewHeun 8 months ago
recca - v0.1.57
Recca 0.1.57 (2025-05-26)
- Update R-CMD-check GitHub action.
extend_to_exergy()now ignores thephivector when computing the exergy version of the U_EIOU matrix if the the energy version of the U_EIOU matrix is the 0 matrix.extend_to_exergy()simply returns the 0 matrix, same as the energy version of the U_EIOU matrix.- No new tests.
- Still at 775 tests, all passing.
- Test coverage remains at 100%.
- R
Published by MatthewHeun 9 months ago
recca - v0.1.56
Recca 0.1.56 (2024-12-09)
- Significantly improved some energy balance error messages. The source of the error is now reported.
- Added row and column types to the result of
calc_eta_i(). - Fixed a bug where missing UEIOU matrix would cause an error in `extendtoexergy()`. We create a UEIOU matrix by multiplying U by 0, thereby keeping the same rows and columns of U.
- Change column names to remove "." characters that are incompatible with storage in PostgreSQL databases (and maybe others).
- Fixed many tests and added a few new tests for new features.
- Now up to 775 tests, all passing.
- Test coverage remains at 100%.
- R
Published by MatthewHeun about 1 year ago
recca - v0.1.55
Recca 0.1.55 (2024-02-06)
- Testing now done in parallel.
- New function
extend_fu_details_to_exergy()converts the final-to-useful details matrices from energy to exergy. - New tests for new features.
- Now up to 763 tests, all passing.
- Test coverage remains at 100%.
- R
Published by MatthewHeun about 2 years ago
recca - v0.1.54
Recca 0.1.54 (2023-12-21)
- Added statement of need to README file.
- Added
Remotes:field toDESCRIPTIONfile to assist installation from theCLPFUDatabasemetapackage. - No new tests.
- Still at 750 tests, all passing.
- Test coverage remains at 100%.
- R
Published by MatthewHeun about 2 years ago
recca - v0.1.52
Recca 0.1.52 (2023-12-01)
- Fixed a bug where
region_aggregates()would fail when no countries to be aggregated were available anddrop_na_fewwasFALSE. - Added code of conduct and contributing pages to documentation.
- New tests for bug fixes.
- Now up to 750 tests, all passing.
- Test coverage remains at 100%.
- R
Published by MatthewHeun over 2 years ago
recca - v0.1.51
Recca 0.1.51 (2023-11-15)
- Fixed a bug in
calc_agg_eta_pfus()where efficiencies were calculated incorrectly when primary energy was different depending on the value of theLast.stagecolumn. - No new tests.
- Still at 748 tests, all passing.
- Test coverage remains at 100%.
- R
Published by MatthewHeun over 2 years ago
recca - v0.1.50
Recca 0.1.50 (2023-11-15)
- New function
calc_agg_eta_pfus()calculates primary, final, useful, and services aggregates and associated efficiencies. - New tests for new features.
- Now up to 748 tests, all passing.
- Test coverage remains at 100%.
- R
Published by MatthewHeun over 2 years ago
recca - v0.1.48
Recca 0.1.48 (2023-10-27)
- New function
remove_neu()eliminates "Non-energy useX" (where "X" is any additional string such as " in Industry") from the final demand matrix (Y) and swims upstream withnew_Y()to remove any primary stage or useful stage energy associated with Non-energy use. - New tests for the new function.
- Now up to 717 tests, all passing.
- Test coverage remains at 100%.
- R
Published by MatthewHeun over 2 years ago
recca - v0.1.47
Recca 0.1.47 (2023-10-23)
- Fixed a bug where EIOU efficiency calculated by calcetafuYeiou() gave the 0 matrix. Hat-tip to Emmanuel Aramendia for spotting this issue and assisting the debugging.
- No new tests.
- Still at 712 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun over 2 years ago
recca - v0.1.46
Recca 0.1.46 (2023-10-16)
- Minor updates to documentation.
- The
byargument topfu_aggregates()now correctly chooses the default value ("Total") if unspecified. - No new tests.
- Still at 712 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun over 2 years ago
recca - v0.1.43
Recca 0.1.43 (2023-08-18)
- Completed the aggregations vignette.
- New function
pfu_aggregates()is a work in progress but should (eventually) make calculating primary, final, and useful aggregates easier. - Breaking change:
UandU_feedarguments removed fromfinaldemand_aggregates(), replaced byU_eiou, which was calculated fromUandU_feedinternally, andU_eiouis assumed to be present in all energy conversion chain representations. - The
byargument tofinaldemand_aggregates()can now be "Industry", which is treated as a synonym for "Sector". - Now returning an
S_units_primecolumn when chopping matrices. - Wrapped some matrices in
as.matrix()to guard against sparse matrices causing a failure incalc_yqfgW(). - New tests for new features.
- Now up to at 712 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun over 2 years ago
recca - v0.1.42
Recca 0.1.42 (2023-06-02)
- Fixed a bug where writing
Matrixobjects failed inwrite_ecc_to_excel(). Thanks to Pierre Jacques for reporting this problem. - New function
calc_eta_fu()calculates final-to-useful efficiencies for every entry in Y and U_EIOU matrices, responding to a feature request from Pierre Jacques. - New tests for new features.
- Now up to at 641 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun almost 3 years ago
recca - v0.1.41
Recca 0.1.41 (2023-04-28)
- Responded to policy changes in
matsindf::matsindf_apply()by setting default arguments toNULLfor several internal functions. region_aggregates()gainsdrop_na_fewargument that tells whether to eliminate rows withNAinfew_colname.- Adjusted example ECC names.
Example changes include:
- "Resources - Crude" --> "Resources [of Crude]"
- "Crude - Fields" --> "Crude [from Fields]"
- "MD - Car engines" --> "MD [from Car engines]" These changes align the example ECC with the naming conventions now in use throughout the package and in various pipelines.
chop_R()now also chops by rows (industries), since we are now including all exogenous sources of energy in the R matrix.- New function
get_all_products_and_industries()generates lists of unique product and industry names for an ECC and is aware ofRCLabels-typepieces of row and column names. - Net EROI calculations removed, only gross values calculated.
- Simplifications reduced number of tests.
- Still at 632 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun almost 3 years ago
recca - v0.1.40
Recca 0.1.40 (2023-01-25)
- This version contains only fixes to the continuous integration build system. There are no changes to any code.
- Remove use of the
Remotes:field in DESCRIPTION. Instead, now usingpkgdependssyntax in theextra-packages:fields ofR_CMD-check.yamlandtest-coverage.yaml. - Update to latest version of the GitHub action for test coverage.
- No new tests.
- Still at 672 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun about 3 years ago
recca - v0.1.39
Recca 0.1.39 (2023-01-24)
- Tests once again all passing on all test rigs of GitHub Actions. Tests had been failing due to new code that correctly detects unit errors (inhomogeneity) for some upstream swim calculations with services as the last stage in an ECC.
- Move tests associated with
verify_cols_missing()from theReccapackage tomatsindf. Those tests didn't belong inRecca, becauseverify_cols_missing()is no longer inRecca. - Eliminated data frame rows for a couple tests
that were producing
NAvalues due to unit inhomogeneity. - Switched to simpler formulas derived by MKH
for
new_R_ps(). - Eliminated
tidyselectwarnings. write_ecc_to_excel()now ensures that columns of U and rows of V are the same, even if it means adding zero columns to U or zero rows to V. This change makes further Excel calculations easier.chopR()now checks for the ability to swim downstream with R_prime = R to re-create the original energy conversion chain, thereby bringing consistency withchopY(). This approach identifies numerical precision errors before they cause a problem.chopR()now usescalc_io_mats(direction = "downstream"), thereby consistently usingcalc_io_mats()for both upstream and downstream swims.calc_io_mats()gains new argumentdirectionthat tells whether the input-output matrices are for "upstream" or "downstream" swims.finaldemand_aggregates()now produces true0instead of a 1x1 matrix without row or column labels when no columns names of U_EIOU or Y matchfd_sectors.- Fixed two bugs in
new_Y(). There were compensatory formula errors that only appeared in some edge cases. - Aggregations are now optional (on by default)
in
chop_R()andchop_Y(). - Renamed
effects_aggregates()andfootprint_aggregates()tochop_R()andchop_Y(). - New function
effects_aggregates()swims downstream from the R matrix to final demand for each column (energy carrier) in the R matrix and calculates primary and final demand aggregates. footprint_aggregates()now checks that the chopped ECCs sum to the original ECC on every calculation.region_aggregates()now correctly eliminates thefew_colnamewhen the incoming data frame has no rows.footprint_aggregates()now also includes the*_prime_colnamematrices in the nested data frame.calc_io_mats()andcalc_L()gainmethodandtolarguments to control matrix inversion.calc_eta_pfd()now includes columns of names of efficiencies in its output. This feature will assist pivoting on efficiencies later.- New function
footprint_aggregates()calculates primary and final demand aggregates for each isolated row and column in Y. new_Y()now also produced matrices U_feed, U_eiou, and r_eiou in its output.- W matrix no longer included in the output of
new_Y(). W can always be calculated from V^T - U. - New function
write_ecc_to_excel()stores ECCs in spatial format in Excel. All ECC matrices are written to the Excel file: R, U, V, Y, U_feed, U_eiou, r_eiou, and S_units. primary_aggregates()andfinaldemand_aggregates()no longer requirep_industriesandfd_sectorsto be present in the incoming list or data frame. Rather,p_industriesandfd_sectorsare treated as parameters that apply to all items in the incoming list or rows in the incoming data frame. This change brings consistency with other functions that usematsindf::matsindf_apply()internally.- New function
group_aggregates()that aggregates PSUT matrices according to an aggregation map. - New function
despecified_aggregates()that aggregates PSUT matrices to a piece of row and column labels. - New argument
add_net_gross_colsonprimary_aggregates()that tells whether to add both net and gross primary energy columns. (Net and gross primary energy aggregate columns will contain identical values, but the presence of both net and gross columns may make it easier to mesh with results from thefinaldemand_aggregates()function, which produces net and gross columns that are different.) aggregate_regions()now returns an empty data frame with the expected columns if the input data frame has no rows.- Many new tests for new features.
- Now up to 672 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun about 3 years ago
recca - v0.1.38
Recca 0.1.38 (2022-04-02)
- Removed unnecessary assertion that
matsbynameis available in aggregation functions. - Eliminated
finaldemand_aggregates_with_units(), because nobody was using it. - New function
calc_eta_pfd()calculates gross and net efficiencies from primary to final demand. - New function
region_aggregates()calculates regional aggregates according to columns in a data frame. - New look for
pkgdownwebsite. extend_to_exergy()gains new argumentsmat_piece,phi_piece,notation, andprepositionsto enable more flexible row and column name matching between the various matrices and phi vectors. In addition,extend_to_exergy()now usesmatsbyname::vec_from_store_byname()internally to correctly handle hatized vector multiplication.- Many new tests for new features.
- Now up to 556 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun almost 4 years ago
recca - v0.1.37
Recca 0.1.37 (2021-10-13)
- Added details to
Reccavignette, including additional equations for embodied matrices. - New function
extend_to_exergy()that calculates an exergy representation of an energy conversion chain given an energy representation of an energy conversion chain. - Many new tests for new features.
- Now up to 530 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun over 4 years ago
recca - v0.1.35
Recca 0.1.35 (2021-08-20)
- R matrix formulation now adopted for input output calculations, for upstream and downstream swims, as well as for embodied energy calculations.
- Added new file
new_R_ps_example.xlsxthat demonstrates equations for swimming "downstream." - Updated to stable and active status badges.
- R
Published by earamendia over 4 years ago
recca - v0.1.32
Recca 0.1.32 (2021-03-16)
- Modified aggregation functions to use simpler (but verbose)
ifstatements to choose aggregation functions. This change works around an error when calling the aggregation functions from other packages. - New tests for new code paths.
- Now at 435 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun almost 5 years ago
recca - v0.1.31
Recca 0.1.31 (2020-02-25)
- New argument to aggregation functions:
pattern_typewhich tells how to match primary and final demand sector names for aggregation. - New tests for new feature.
- Now 421 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun about 5 years ago
recca - v0.1.30
Recca 0.1.30 (2020-02-22)
- Fixed bugs in
finaldemand_aggregates()andfinaldemand_aggregates_with_units()where argumentfd_sectorswas not respected for gross energy aggregation. - New and revamped tests to guard against regression.
- Now 417 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun about 5 years ago
recca - v0.1.28
Recca 0.1.28 (2020-12-23)
- New function
find_p_industry_names()looks atR,V, andYmatrices to find names of primary industries (industries that produce primary energy). The function looks for prefixes among row (RandV) and column (Y) names to identify primary industries. - New tests for new function.
- Now 416 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun about 5 years ago
recca - v0.1.27
Recca 0.1.27 (2020-12-08)
- Move IEA aggregation functions out of this package and into the
IEAToolspackage. - Now using package constants for names of aggregate columns.
Column names match similar names in
IEATools. - Now using better function-matching and -selecting code in
finaldemand_aggregates() - Fewer tests due to moving some functions out of the package.
- Now 411 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun about 5 years ago
recca - v0.1.26
Recca 0.1.26 (2020-12-06)
primary_aggregates(),finaldemand_aggregates(), andfinaldemandaggregateswithunits()now require a column ofpindustriesorfdsectorsinstead of a vector when a.sutdatais a data frame. This change works around a problem with a common use case where the caller would create thefdsectorscolumn from the column names ofY` vectors in the data frame.- Working to modernize the Recca code.
- Use R markdown in documentation (
`term`instead of\code{term}). - Use package constants for column name arguments
(
Recca::sankey_cols$sankeyinstead of "Sankey").
- Use R markdown in documentation (
- New tests for the new feature.
- Now up to 413 tests, all passing.
- Test coverage remains at 100 %.
- R
Published by MatthewHeun about 5 years ago
recca - Recca 0.1.25 (2020-09-17)
- New author Emmanuel Aramendia. Welcome!
- Added tests for new features and old bugs.
- Now up to 407 tests, all of which pass.
- Test coverage remains at 100 %.
- Test coverage now up to 100%.
- Created a new function
calc_embodied_EIOU()that calculates different embodied EIOU matrices for a given final demand - Created a new function
calc_erois()that calculates different vector of product-level and industry-level EROIs using different assumptions. - Created a new function
calc_E_EIOU()that calculates theE_EIOUmatrix of EIOU energy use by unit of industry output, split by product. It also calculates the direct energy extension vector e_EIOU of total EIOU energy use by unit of industry output. - Fixed a bug in one of the vignettes related to the move from
U_excl_EIOUtoU_feed. prep_UK2000.Randprep_perfectsub.Rscripts fixed to work withIEATools, which now usesU_feedinstead ofU_excl_EIOU.
- R
Published by earamendia over 5 years ago
recca - v0.1.22
Recca 0.1.22 (2020-05-02)
- Fixed a bug in
primary_aggregates().primary_aggregates()had been assuming that either theRor theVmatrix (but not both) could contain industries counted in total primary energy supply (production, imports, exports, etc.). However, that is not true.Ris for resource industries, so imports, exports, marine and aviation bunkers, and stock changes are excluded fromR. However, imports, exports, marine and aviation bunkers, and stock changes are included in total primary energy supply. I removed the conditionalxorcheck for appearance of TPES industries inRandV. Everything seems to be working now.
- R
Published by MatthewHeun almost 6 years ago
recca - v0.1.19
Recca 0.1.19 (2020-02-19)
- Remove dependency on package
qgraph.qgraphdependedn uponggraph, which is apparently no longer available on CRAN. The dependency onqgraphwas only for graphical representations of ECCs. But, graphical representations of ECCs are not presently implemented inRecca. Future versions ofReccamay implement graphical representations. I can reassess the packages for graphing and Sankey diagrams at a later date.
- R
Published by MatthewHeun about 6 years ago
recca - v0.1.18
- Updates to synchronize with recent changes in other packages.
In particular, there was one place where
grouping on a column of a data frame withNAentries was causing a warning to be emitted. Now, thegroupinghappens after splitting the data frame into rows wtihNAentries and those without. Grouping and sorting happens only for the rows withoutNAvalues.
- R
Published by MatthewHeun about 6 years ago
recca - v0.1.16
Recca 0.1.16 (2019-02-16)
- Now automatically building in Travis.
- Added new
reverse()function to change flow direction of an ECC.reverse()will be useful for downstream swim functions. - Simplified and improved
resource_industries()function.- No longer summing columns of
Umatrix. - Instead, cleaning 0 columns of
Uand comparing names of columns to the originalU.
- No longer summing columns of
- Eliminated all
@importFromstatements by fully-qualifying all function calls. - Test coverage now up to 100%.
- R
Published by MatthewHeun about 7 years ago
recca - v0.1.14
Recca 0.1.14 (2019-01-14)
- New function
make_sankey()does what it says: makes a Sankey diagram.make_sankey()is the first function that optionally uses the resource (R) matrix. edge_list()also now accepts a resource (R) matrix on input.- The vigenette describing the
new*functions now has a section onnew_R_ps().
- R
Published by MatthewHeun about 7 years ago
recca - v0.1.13
Recca 0.1.13 (2018-12-21)
calc_F_footprint_effects()now cleans rows and columns (deletes rows and columns containing all 0s) before calculating row and column fractions.calc_F_footprint_effects()now calculates row and column fractions usingmatsbyname::fractionize_byname(), providing a speed boost.
- R
Published by MatthewHeun about 7 years ago
recca - v0.1.10
Recca 0.1.10 (2018-11-29)
- Now importing
magrittrpipe at high level. - Now using
hatinv_bynamefunction instead ofhatize_byname %>% invert_byname. - Breaking change: arguments to
Reccafunctions are no longer named*_colname. I'm standardizing argument names. The new approach yields better code when calling functions with individual matrices: every matrix needs to be named. And when using functions to operate on a data frame the default values for column names mean that data frames can be piped to functions that are called with no parameters. Furthermore, this change allows lists output from previous functions to be used in later function calls without name changes. For example,f1produces a listlwith named itemz, andzis an input tof2. The previous naming convention would require user mappingztoz_colname:f2(z_colname = l$z). The new naming convention allowsf2(l), becauselcontains named itemz, andf2has an argument new namedz(where it had been namedz_colnamebefore). In all ways, the new argument naming convention is more elegant than the previous*_colnameapproach. - Building a vignette that describes the package.
- New test for a simple, 1-industry ECC.
- Now up to 316 tests.
- R
Published by MatthewHeun over 7 years ago
recca - v0.1.9
Recca 0.1.9 (2018-11-08)
Breaking change:
reconstruct_UV-->new_Y. This change allows for severalnew_*functions that assess changes to the ECC when some part of the ECC changes.New function
new_k_psassesses changes to the ECC when proportion of inputs to an industry change under the assumption of perfect substitution.New functions
products_unit_homogeneous,inputs_unit_homogeneous, andoutputs_unit_homogeneoustest whether products, inputs to all industries, and outputs from all industries are unit-homogeneous.
- R
Published by MatthewHeun over 7 years ago
recca - v0.1.2
Recca 0.1.2 (2018-05-20)
- All functions now use the
matsindf::matsindf_applyfunction Ffunctions now do internal energy balance checks.- Much code and API cleanup.
- Note that some API changes are expected,
particularly name changes for
*_colnamearguments.
- R
Published by MatthewHeun almost 8 years ago
recca - v0.1.1
Recca 0.1.1 (2018-04-16)
- Many new functions
calc_io_mats: calculate input-output (PSUT version) matrices, includingy,q,g,W,Z,D,C,A,L_ixp, andL_pxp.reconstruct_UV: Reconstruct the energy conversion chain (newUandVmatrices) from a new final demand matrix (Y)
- R
Published by MatthewHeun almost 8 years ago