Skip to contents


ghgtools is designed to make greenhouse gas (GHG) accounting more accessible and standardized. Tracking, measuring, and reporting GHG emissions is essential to understand risks and identify opportunities related to climate change and the transition towards a renewable energy economy. The goal of this package is to advance the practice of GHG accounting with tools rooted in uncompromising transparency, rigorous data quality, and purposeful versatility.

The Basics

The GHG inventory of any entity can be summarized as follows: Assets, such as buildings, vehicles, and equipment, engage in Activities, such as electricity consumption, travel, or purchasing, which each have a specific Emission Factor that tells us the rate at which that activity generates GHG emissions. These three variables - assets, actives, and emission factors - compose the underlying calculation methodology. ghgtools uses a set of standardized data templates to match each record of activity data to an emission factor using information about your assets. Our methodology is built on the best practices set forth by the GHG Protocol Corporate Standard.

The following data sets are required to use ghgtools and calculate GHG emissions. When you library(ghgtools), these data sets are available.

Emission Factor Library - EFLibrary - The catalog of emission factors for a variety of activities. Our team consolidates emission factors from a collection of reputable sources, such as the EPA’s Emission Factor Hub. Unless you want to add your own custom emission factors (which you certainly can, these tools are open source after all!), you don’t need to worry about the emission factor library. It is pre-populated and ready to go.

Asset Portfolio - AssetPortfolio - The list of all your assets. This likely includes buildings and vehicles. You may also designate an Enterprise asset to calculate scope 3 emissions for purchasing, business travel, and other supply chain related activities.

Activity Data - ActivityData - The record of energy consumption and other GHG-producing activities across each of your assets.

Data and Templates

First, we need to load ghgtools

The emission factor library, EFLibrary, is loaded from the ghgtools package. There is a row of data for each greenhouse gas produced by the activity. For example, burning natural gas will generate CO2, CH4 and N2O. EFLibrary is loaded when you library ghgtools. An example of the emission factors for Aviation Gasoline is provided below. Check out the Emission Factor Library article for more guidance and information.


ef_source ef_publishdate ef_activeyear service_type unit emission_category service_subcategory1 service_subcategory2 supplier emission_scope country subregion ghg ghg_unit source_emission_factor unit_conversion conversion_factor ghg_perunit V19 V20
EPA CCCL Emission Factors for GHG Inventories 2023-09-12 2023 Aviation Gasoline gallons Mobile Scope 1 United States CO2 kg 8.31 1 kg_per_kg 8.31000
EPA CCCL Emission Factors for GHG Inventories 2023-09-12 2023 Aviation Gasoline gallons Mobile Scope 1 United States CH4 kg 0.00036 1 kg_per_kg 0.00036
EPA CCCL Emission Factors for GHG Inventories 2023-09-12 2023 Aviation Gasoline gallons Mobile Scope 1 United States N2O kg 7e-05 1 kg_per_kg 0.00007


ghgtools comes with templates for activity data and the asset portoflio. You can use create_templates() to write these templates to excel files in your working directory. create_templates() also writes the full emission factor library to an excel file in your working directory.

create_templates()
#> [1] "Success! Check your directory for ActivityData.csv, AssetPortfolio.csv, and EFLibrary.csv"

See below for some example data from the templates.

Activity Data Template - See ActivityData reference documentation for more information about the activity data template.

asset_id supplier account_id meter_number date year cost service_type service_subcategory1 service_subcategory2 unit usage
B1456 2023 Electricity kWh 31231.91
B1457 2023 Electricity kWh 19389.59
B1458 2023 Electricity kWh 185862.41
B1458 2023 Natural Gas therms 2569.69


Asset Portfolio Template - See AssetPortfolio reference documentation for more information about the asset portfolio template.

asset_id asset_name asset_description address city state zip country sqft region business_unit asset_type asset_subtype year_built
B1456 Bellingham Washington 98226 United States 342 West Coast Operations Building Office 1993
B1457 Bellingham Washington 98225 United States 3280 West Coast Operations Building Office 2005
B1458 Bellingham Washington 98225 United States 20142 West Coast Operations Building Office 2003


Running ghg_inventory()

The core function of ghgtools is ghg_inventory(). This function requires activity data, an asset portoflio, and a GWP selection.You may choose to provide an emission factor library, otherwise ghg_inventory() will default to the internal emission factor library EFLibrary

  • Activity Data must be a data frame following the structure of the activity data template.
  • Asset Portfolio must be a data frame following the structure of the asset portfolio template.
  • GWP choose a global wamring potential to use for the GHG inventory calcualtions. Choices are “SAR”, “AR4”, “AR5”, or “AR6”. If you have no preference for GWPs, we recommend following UNFCCC guidelines, which require the use of GWP values from the IPCC’s Fifth Assessment Report (AR5).
  • Emission Factor Library must be a data frame following the structure of EFLibrary. You may have custom or unique emission factors that you wish to use in ghgtools, in which case you can load your own emission factor library into r studio. You may also append additional emission factors onto the default EFLibrary.

You may prefer to use excel to overwrite the activity data and asset portfolio data templates with your own data. This is why create_templates() writes an excel file in your working directory. Once you add your data to the templates, you can use the fread() function to create global environment variables for use in ghgtools. If you decide to make any changes to the emission factor library, again use fread() to create a global environment variable.

library(data.table)
My_ActivityData <- fread("ActivityData.csv")
My_AssetPortfolio <- fread("AssetPortfolio.csv")
My_EFLibrary <- fread("EFLibrary.csv")

With the variables created above, you can run ghg_inventory().

GHG_rawdata <- ghg_inventory(My_ActivityData, My_AssetPortfolio, "AR5", My_EFLibrary)

Let’s take a look at the ghg inventory that was calculated:

asset_id asset_name asset_type asset_subtype asset_description address city state zip country region subregion business_unit year_built sqft service_type unit supplier account_id meter_number date year cost usage emission_category service_subcategory1 service_subcategory2 emission_scope co2_kgperunit ch4_kgperunit n2o_kgperunit otherghgs_kgco2eperunit gwps_ar co2_gwp ch4_gwp n2o_gwp kgco2e_perunit kg_co2 kg_ch4 kg_n2o kg_co2e mt_co2e ef_source ef_publishdate
B1456 Building Office Bellingham Washington 98226 United States West Coast NWPP Operations 1993 342 Electricity kWh 2023 31231.907 Indirect Energy Scope 2 0.2731025 0.0000254 3.60e-06 0.0000000 AR5 1 28 265 0.2747756 8529.5111 0.7932904 0.1133718 8581.7668 8.5817668 USEPA eGRID2022 01/30/2024
B1457 Building Office Bellingham Washington 98225 United States West Coast NWPP Operations 2005 3280 Electricity kWh 2023 19389.588 Indirect Energy Scope 2 0.2731025 0.0000254 3.60e-06 0.0000000 AR5 1 28 265 0.2747756 5295.3445 0.4924955 0.0703842 5327.7862 5.3277862 USEPA eGRID2022 01/30/2024
B1458 Building Office Bellingham Washington 98225 United States West Coast NWPP Operations 2003 20142 Electricity kWh 2023 185862.407 Indirect Energy Scope 2 0.2731025 0.0000254 3.60e-06 0.0000000 AR5 1 28 265 0.2747756 50759.4835 4.7209051 0.6746805 51070.4592 51.0704592 USEPA eGRID2022 01/30/2024
B1458 Building Office Bellingham Washington 98225 United States West Coast Operations 2003 20142 Natural Gas therms 2023 2569.690 Stationary Scope 1 5.3060000 0.0001000 1.00e-05 0.0000000 AR5 1 28 265 5.3114500 13634.7751 0.2569690 0.0256969 13648.7800 13.6487800 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
B1564 Building Office Woodinville Washington 98072 United States West Coast NWPP Operations 1990 3636 Electricity kWh 2023 47302.603 Indirect Energy Scope 2 0.2731025 0.0000254 3.60e-06 0.0000000 AR5 1 28 265 0.2747756 12918.4580 1.2014861 0.1717084 12997.6024 12.9976024 USEPA eGRID2022 01/30/2024
B1564 Building Office Woodinville Washington 98072 United States West Coast Operations 1990 3636 Natural Gas therms 2023 1382.843 Stationary Scope 1 5.3060000 0.0001000 1.00e-05 0.0000000 AR5 1 28 265 5.3114500 7337.3650 0.1382843 0.0138284 7344.9015 7.3449015 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
B1662 Building Office Portland Oregon 97202 United States West Coast NWPP Operations 2007 4821 Electricity kWh 2023 106760.001 Indirect Energy Scope 2 0.2731025 0.0000254 3.60e-06 0.0000000 AR5 1 28 265 0.2747756 29156.4206 2.7117040 0.3875388 29335.0461 29.3350461 USEPA eGRID2022 01/30/2024
B1662 Building Office Portland Oregon 97202 United States West Coast Operations 2007 4821 Natural Gas therms 2023 3541.052 Stationary Scope 1 5.3060000 0.0001000 1.00e-05 0.0000000 AR5 1 28 265 5.3114500 18788.8219 0.3541052 0.0354105 18808.1206 18.8081206 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
B1663 Building Office Portland Oregon 97229 United States West Coast NWPP Operations 2015 4316 Electricity kWh 2023 74746.451 Indirect Energy Scope 2 0.2731025 0.0000254 3.60e-06 0.0000000 AR5 1 28 265 0.2747756 20413.4408 1.8985599 0.2713296 20538.5029 20.5385029 USEPA eGRID2022 01/30/2024
B1663 Building Office Portland Oregon 97229 United States West Coast Operations 2015 4316 Natural Gas therms 2023 1793.131 Stationary Scope 1 5.3060000 0.0001000 1.00e-05 0.0000000 AR5 1 28 265 5.3114500 9514.3531 0.1793131 0.0179313 9524.1256 9.5241256 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
B1866 Building Office Sacramento California 95816 United States West Coast CAMX Operations 1999 6074 Electricity kWh 2023 85928.162 Indirect Energy Scope 2 0.2256363 0.0000136 1.80e-06 0.0000000 AR5 1 28 265 0.2264968 19388.5135 1.1686230 0.1555300 19462.4504 19.4624504 USEPA eGRID2022 01/30/2024
B1867 Building Office Sacramento California 95825 United States West Coast CAMX Operations 2004 3959 Electricity kWh 2023 44956.454 Indirect Energy Scope 2 0.2256363 0.0000136 1.80e-06 0.0000000 AR5 1 28 265 0.2264968 10143.8084 0.6114078 0.0813712 10182.4912 10.1824912 USEPA eGRID2022 01/30/2024
B1868 Building Office Sacramento California 95825 United States West Coast CAMX Operations 2004 8070 Electricity kWh 2023 106728.394 Indirect Energy Scope 2 0.2256363 0.0000136 1.80e-06 0.0000000 AR5 1 28 265 0.2264968 24081.8011 1.4515062 0.1931784 24173.6355 24.1736355 USEPA eGRID2022 01/30/2024
B2074 Building Office Indio California 92203 United States West Coast AZNM Operations 2010 3543 Electricity kWh 2023 49348.000 Indirect Energy Scope 2 0.3520039 0.0000231 3.20e-06 0.0000000 AR5 1 28 265 0.3534934 17370.6908 1.1399388 0.1569266 17444.1947 17.4441947 USEPA eGRID2022 01/30/2024
B2074 Building Office Indio California 92203 United States West Coast Operations 2010 3543 Natural Gas therms 2023 25.981 Stationary Scope 1 5.3060000 0.0001000 1.00e-05 0.0000000 AR5 1 28 265 5.3114500 137.8552 0.0025981 0.0002598 137.9968 0.1379968 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
LS101 Equipment Mobile Landscaping equipment Bellingham Washington 98226 United States West Coast Operations Motor Gasoline gallons 2023 708.000 Mobile Scope 1 8.7800000 0.0003800 8.00e-05 0.0000000 AR5 1 28 265 8.8118400 6216.2400 0.2690400 0.0566400 6238.7827 6.2387827 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
Enterprise Enterprise United States West Coast Capital Goods USD 2023 22219.240 Capital Goods Manufacturing Electronic Computer Manufacturing Scope 3 0.0821375 0.0002905 1.22e-05 0.0063312 AR5 1 28 265 0.0998362 1825.0331 6.4551114 0.2710747 2218.2850 2.2182850 US EPA Supply Chain Emission Factors 04/20/2023
Enterprise Enterprise United States West Coast Capital Goods USD 2023 424731.110 Capital Goods Manufacturing All Other Miscellaneous General Purpose Machinery Manufacturing Scope 3 0.2016023 0.0006110 2.48e-05 0.0050865 AR5 1 28 265 0.2303679 85626.7491 259.4975415 10.5333315 97844.4285 97.8444285 US EPA Supply Chain Emission Factors 04/20/2023
Enterprise Enterprise United States West Coast Purchased Goods and Services USD 2023 533840.640 Purchased Goods and Services Professional, Scientific, and Technical Services All Other Legal Services Scope 3 0.0407606 0.0001567 4.60e-06 0.0017602 AR5 1 28 265 0.0481355 21759.6808 83.6549637 2.4716822 25696.6934 25.6966934 US EPA Supply Chain Emission Factors 04/20/2023
Enterprise Enterprise United States West Coast Purchased Goods and Services USD 2023 130615.220 Purchased Goods and Services Professional, Scientific, and Technical Services Human Resources Consulting Services Scope 3 0.0605687 0.0002976 8.60e-06 0.0043348 AR5 1 28 265 0.0755089 7911.1956 38.8659955 1.1206786 9862.6153 9.8626153 US EPA Supply Chain Emission Factors 04/20/2023
Enterprise Enterprise United States West Coast Purchased Goods and Services USD 2023 988346.400 Purchased Goods and Services Professional, Scientific, and Technical Services Landscape Architectural Services Scope 3 0.0933181 0.0003284 1.83e-05 0.0034681 AR5 1 28 265 0.1108301 92230.5825 324.5472608 18.0867391 109538.5704 109.5385704 US EPA Supply Chain Emission Factors 04/20/2023
Enterprise Enterprise United States West Coast Purchased Goods and Services USD 2023 154157.660 Purchased Goods and Services Administrative and Support and Waste Mgmt. Services Facilities Support Services Scope 3 0.1602254 0.0006920 2.41e-05 0.0039080 AR5 1 28 265 0.1898948 24699.9684 106.6712427 3.7151996 29273.7389 29.2737389 US EPA Supply Chain Emission Factors 04/20/2023
Enterprise Enterprise United States West Coast Purchased Goods and Services USD 2023 42621.180 Purchased Goods and Services Administrative and Support and Waste Mgmt. Services Janitorial Services Scope 3 0.1091645 0.0005265 2.46e-05 0.0232457 AR5 1 28 265 0.1536699 4652.7215 22.4381333 1.0484810 6549.5943 6.5495943 US EPA Supply Chain Emission Factors 04/20/2023
Enterprise Enterprise United States West Coast Purchased Goods and Services USD 2023 160131.340 Purchased Goods and Services Administrative and Support and Waste Mgmt. Services Office Administrative Services Scope 3 0.0772075 0.0003372 1.62e-05 0.0028183 AR5 1 28 265 0.0937597 12363.3406 53.9927650 2.5941277 15013.8729 15.0138729 US EPA Supply Chain Emission Factors 04/20/2023
Enterprise Enterprise United States West Coast Purchased Goods and Services USD 2023 15929.275 Purchased Goods and Services Administrative and Support and Waste Mgmt. Services Security Systems Services (except Locksmiths) Scope 3 0.0603046 0.0002553 7.80e-06 0.0019502 AR5 1 28 265 0.0714570 960.6086 4.0668076 0.1234519 1138.2589 1.1382589 US EPA Supply Chain Emission Factors 04/20/2023
Enterprise Enterprise United States West Coast Purchased Goods and Services USD 2023 321181.500 Purchased Goods and Services Educational Services Professional and Management Development Training Scope 3 0.0915574 0.0005185 1.03e-05 0.0031904 AR5 1 28 265 0.1119962 29406.5286 166.5428856 3.3081694 35971.0919 35.9710919 US EPA Supply Chain Emission Factors 04/20/2023
Enterprise Enterprise United States West Coast Purchased Goods and Services USD 2023 1795761.130 Purchased Goods and Services Information Wireless Telecommunications Carriers (except Satellite) Scope 3 0.1276521 0.0004146 1.57e-05 0.0073369 AR5 1 28 265 0.1507596 229232.6470 744.6105568 28.1934497 270728.2735 270.7282735 US EPA Supply Chain Emission Factors 04/20/2023
Enterprise Enterprise United States West Coast Business Travel vehicle-mile 2023 15000.000 Business Travel Ground Travel Passenger Car Scope 3 0.3130000 0.0000080 7.00e-06 0.0000000 AR5 1 28 265 0.3150790 4695.0000 0.1200000 0.1050000 4726.1850 4.7261850 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
Enterprise Enterprise United States West Coast Business Travel vehicle-mile 2023 500.000 Business Travel Ground Travel Light-Duty Truck Scope 3 0.4670000 0.0000130 1.20e-05 0.0000000 AR5 1 28 265 0.4705440 233.5000 0.0065000 0.0060000 235.2720 0.2352720 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
Enterprise Enterprise United States West Coast Business Travel passenger-mile 2023 37000.000 Business Travel Rail Travel Intercity Rail - National Average Scope 3 0.1130000 0.0000092 2.60e-06 0.0000000 AR5 1 28 265 0.1139466 4181.0000 0.3404000 0.0962000 4216.0242 4.2160242 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
Enterprise Enterprise United States West Coast Business Travel passenger-mile 2023 60000.000 Business Travel Air Travel Air Travel - Short Haul Scope 3 0.2070000 0.0000064 6.60e-06 0.0000000 AR5 1 28 265 0.2089282 12420.0000 0.3840000 0.3960000 12535.6920 12.5356920 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
Enterprise Enterprise United States West Coast Business Travel passenger-mile 2023 110000.000 Business Travel Air Travel Air Travel - Medium Haul Scope 3 0.1290000 0.0000006 4.10e-06 0.0000000 AR5 1 28 265 0.1301033 14190.0000 0.0660000 0.4510000 14311.3630 14.3113630 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
Enterprise Enterprise United States West Coast Business Travel passenger-mile 2023 73000.000 Business Travel Air Travel Air Travel - Long Haul Scope 3 0.1630000 0.0000006 5.20e-06 0.0000000 AR5 1 28 265 0.1643948 11899.0000 0.0438000 0.3796000 12000.8204 12.0008204 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
Enterprise Enterprise United States West Coast Employee Commuting vehicle-mile 2023 70000.000 Employee Commuting Ground Travel Passenger Car Scope 3 0.3130000 0.0000080 7.00e-06 0.0000000 AR5 1 28 265 0.3150790 21910.0000 0.5600000 0.4900000 22055.5300 22.0555300 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
Enterprise Enterprise United States West Coast Employee Commuting passenger-mile 2023 84000.000 Employee Commuting Rail Travel Transit Rail Scope 3 0.0960000 0.0000080 1.10e-06 0.0000000 AR5 1 28 265 0.0965155 8064.0000 0.6720000 0.0924000 8107.3020 8.1073020 EPA CCCL Emission Factors for GHG Inventories 09/12/2023
Enterprise Enterprise United States West Coast Employee Commuting passenger-mile 2023 3000.000 Employee Commuting Ground Travel Bus Scope 3 0.0550000 0.0000063 1.10e-06 0.0000000 AR5 1 28 265 0.0554679 165.0000 0.0189000 0.0033000 166.4037 0.1664037 EPA CCCL Emission Factors for GHG Inventories 09/12/2023


ghg_inventory() has merged our AssetPortoflio, ActivityData, and EFL to generate a GHG emissions inventory report. This data can now be used for a variety of climate disclosure needs.

Visualize your GHG Inventory

Using ggplot2() we can begin to visualize the inventory created by ghgtools.




Visit ghgtools.io for updates and more information!