| Title: | Predict Carbon Emissions for UK SMEs |
|---|---|
| Description: | Predict Scope 1, 2 and 3 carbon emissions for UK Small and Medium-sized Enterprises (SMEs), using Standard Industrial Classification (SIC) codes and annual turnover data, as well as Scope 1 carbon emissions for UK farms. The 'carbonpredict' package provides single and batch prediction, plotting, and workflow tools for carbon accounting and reporting. The package utilises pre-trained models, leveraging rich classified transaction data to accurately predict Scope 1, 2 and 3 carbon emissions for UK SMEs as well as identifying emissions hotspots. It also provides Scope 1 carbon emissions predictions for UK farms of types: Cereals ex. rice, Dairy, Mixed farming, Sheep and goats, Cattle & buffaloes, Poultry, Animal production and Support for crop production. The methodology used to produce the estimates in this package is fully detailed in the following peer-reviewed publications: Phillpotts, A., Owen. A., Norman, J., Trendl, A., Gathergood, J., Jobst, Norbert., Leake, D. (2025) <doi:10.1111/jiec.70106> "Bridging the SME Reporting Gap: A New Model for Predicting Scope 1 and 2 Emissions" and Wells, J., Trendl, A., Owen, A., Barrett, J., Gridley, J., Jobst, N., Leake, D. (2025) <doi:10.1088/1748-9326/ae20ab> "A Scalable Tool for Farm-Level Carbon Accounting: Evidence from UK Agriculture". |
| Authors: | Hamza Suleman [aut, cre, cph], Alec Phillpotts [ctb, aut], Jasmine Wells [ctb, aut], David Leake [ctb, aut] |
| Maintainer: | Hamza Suleman <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 2.0.1 |
| Built: | 2026-05-24 10:14:49 UTC |
| Source: | https://github.com/david-leake/carbonpredict |
Prediction entry point for batch SME and Farms emissions
batch_predict_emissions(data, output_path = NULL, company_type = "sme")batch_predict_emissions(data, output_path = NULL, company_type = "sme")
data |
A single entry (list or named vector), a data frame, or a path to a CSV file. The data should contain company_name, 2-digit UK sic_code, and annual turnover columns. |
output_path |
Optional file path to save the results as a CSV. If NULL, results are not saved to a file. |
company_type |
A single parameter "sme" or "farm" to determine which emission prediction functions to call (defaults to "sme"). |
A data frame with input columns and predicted emissions for each scope (in tCo2e). Optionally saved to a CSV file.
sample_data <- read.csv(system.file("extdata", "sme_examples.csv", package = "carbonpredict")) sample_data <- head(sample_data, 3) batch_predict_emissions(data = sample_data, output_path = NULL, company_type = "sme")sample_data <- read.csv(system.file("extdata", "sme_examples.csv", package = "carbonpredict")) sample_data <- head(sample_data, 3) batch_predict_emissions(data = sample_data, output_path = NULL, company_type = "sme")
Batch plot SME Scope 1 & 2 emissions
batch_sme_plots(data, output_path = NULL)batch_sme_plots(data, output_path = NULL)
data |
A data frame or path to a CSV file with columns "sic_code", "turnover", and optionally "company_name". |
output_path |
Optional directory to save plots. If NULL, plots are not saved. |
Donut chart plots showing scope 1 and 2 predicted emissions (in tCo2e) for each row in the data. Optionally saved to a directory as PNG files.
sample_data <- read.csv(system.file("extdata", "sme_examples.csv", package = "carbonpredict")) sample_data <- head(sample_data, 3) batch_sme_emissions <- batch_predict_emissions( data = sample_data, company_type = "sme", output_path = NULL) batch_sme_plots(data = batch_sme_emissions, output_path = NULL)sample_data <- read.csv(system.file("extdata", "sme_examples.csv", package = "carbonpredict")) sample_data <- head(sample_data, 3) batch_sme_emissions <- batch_predict_emissions( data = sample_data, company_type = "sme", output_path = NULL) batch_sme_plots(data = batch_sme_emissions, output_path = NULL)
This function loads a pre-trained emission model to predict scope 1 carbon emissions for a British farm. The function predicts emissions for the following farm types: "Cereals ex. rice", "Dairy", "Mixed farming", "Sheep and goats", "Cattle & buffaloes", "Poultry", "Animal production", "Support for crop production".
farms_scope1( sic_code, farm_area, no_beef_cows, no_dairy_cows, no_pigs, no_sheep, annual_revenue, annual_fuel_spend )farms_scope1( sic_code, farm_area, no_beef_cows, no_dairy_cows, no_pigs, no_sheep, annual_revenue, annual_fuel_spend )
sic_code |
A 4-digit UK SIC code (numeric). |
farm_area |
Farm area in hectares. |
no_beef_cows |
Number of beef cows. |
no_dairy_cows |
Number of dairy cows. |
no_pigs |
Number of pigs. |
no_sheep |
Number of sheep. |
annual_revenue |
Annual revenue (£) |
annual_fuel_spend |
Annual fuel spend (£) |
A dataframe with predicted emissions (tCO2e)
farms_scope1( sic_code = 1110, farm_area = 1113, no_beef_cows = 25, no_dairy_cows = 8, no_pigs = 18, no_sheep = 29, annual_revenue = 2986511, annual_fuel_spend = 209055)farms_scope1( sic_code = 1110, farm_area = 1113, no_beef_cows = 25, no_dairy_cows = 8, no_pigs = 18, no_sheep = 29, annual_revenue = 2986511, annual_fuel_spend = 209055)
Plots a Sankey diagram showing the breakdown of Scope 3 emissions by category.
plot_scope3_emissions(scope3_df, company_name = NULL)plot_scope3_emissions(scope3_df, company_name = NULL)
scope3_df |
Data frame output from sme_scope3 (must contain 'Category', 'Description', and 'Predicted Emissions (tCO2e)'). |
company_name |
Optional company name to include in the chart title (character string). |
A Sankey plot showing a breakdown for predicted emissions of each Scope 3 category.
scope3_df <- sme_scope3(85, 12000000) plot_scope3_emissions(scope3_df, company_name = "Carbon Predict LTD")scope3_df <- sme_scope3(85, 12000000) plot_scope3_emissions(scope3_df, company_name = "Carbon Predict LTD")
Plot a donut chart of Scope 1,2 and 3 emissions
plot_sme_emissions( scope1_emissions, scope2_emissions, scope3_emissions, company_name = NULL )plot_sme_emissions( scope1_emissions, scope2_emissions, scope3_emissions, company_name = NULL )
scope1_emissions |
Value for total Scope 1 emissions (numeric). |
scope2_emissions |
Value for total Scope 2 emissions (numeric). |
scope3_emissions |
Value for total Scope 3 emissions (numeric). |
company_name |
Optional company name to include in the chart title (character string). |
A ggplot2 donut chart showing predicted emissions for each scope.
scope_1 = sme_scope1(85, 12000000) scope_2 = sme_scope2(85, 12000000) scope_3 = sme_scope3(85, 12000000) plot_sme_emissions( scope1_emissions = scope_1$`Predicted Emissions (tCO2e)`, scope2_emissions = scope_2$`Predicted Emissions (tCO2e)`, scope3_emissions = scope_3[scope_3$Category == "Total", "Predicted Emissions (tCO2e)"][[1]], company_name = "Carbon Predict LTD")scope_1 = sme_scope1(85, 12000000) scope_2 = sme_scope2(85, 12000000) scope_3 = sme_scope3(85, 12000000) plot_sme_emissions( scope1_emissions = scope_1$`Predicted Emissions (tCO2e)`, scope2_emissions = scope_2$`Predicted Emissions (tCO2e)`, scope3_emissions = scope_3[scope_3$Category == "Total", "Predicted Emissions (tCO2e)"][[1]], company_name = "Carbon Predict LTD")
Calls the Scope 1, 2 and 3 emissions prediction functions and returns their results as a list and plots a donut chart
sme_emissions_profile(sic_code, turnover, company_name = NULL)sme_emissions_profile(sic_code, turnover, company_name = NULL)
sic_code |
A 2-digit UK SIC code (numeric). |
turnover |
Annual turnover value (numeric). |
company_name |
Optional company name for labeling plots (character string). |
A list with four elements: scope1, scope2 scope3, scope3_hotspots, each containing the predicted carbon emissions data frame (in tCo2e), the top 5 scope 3 emissions hotspots, as well as a donut chart and Sankey diagram showing the emissions breakdowns.
sme_emissions_profile(sic_code = 85, turnover = 12000000, company_name = "Carbon Predict LTD")sme_emissions_profile(sic_code = 85, turnover = 12000000, company_name = "Carbon Predict LTD")
This function loads a pre-trained emission model to predict scope 1 carbon emissions for a given SIC code and turnover.
sme_scope1(sic_code, turnover)sme_scope1(sic_code, turnover)
sic_code |
A 2-digit UK SIC code (numeric). |
turnover |
Annual turnover value (numeric). |
A data frame with predicted emissions (in tCo2e).
sme_scope1(sic_code = 85, turnover = 12000000)sme_scope1(sic_code = 85, turnover = 12000000)
This function loads a pre-trained emission model to predict scope 2 carbon emissions for a given SIC code and turnover.
sme_scope2(sic_code, turnover)sme_scope2(sic_code, turnover)
sic_code |
A 2-digit UK SIC code (numeric). |
turnover |
Annual turnover value (numeric). |
A data frame with predicted emissions (in tCo2e).
sme_scope2(sic_code = 85, turnover = 12000000)sme_scope2(sic_code = 85, turnover = 12000000)
This function loads pre-trained emissions models to predict scope 3 carbon emissions for a given SIC code and turnover.
sme_scope3(sic_code, turnover)sme_scope3(sic_code, turnover)
sic_code |
A 2-digit UK SIC code (numeric). |
turnover |
Annual turnover value (numeric). |
A data frame with predicted emissions (in tCo2e) for each scope 3 category.
sme_scope3(sic_code = 85, turnover = 12000000)sme_scope3(sic_code = 85, turnover = 12000000)
This function uses pre-computed results to predict the top 5 scope 3 carbon emissions hotspots for a given SIC code.
sme_scope3_hotspots(sic_code)sme_scope3_hotspots(sic_code)
sic_code |
A 2-digit UK SIC code (numeric). |
A data frame with the top 5 emissions hotspots for scope 3.
sme_scope3_hotspots(sic_code = 85)sme_scope3_hotspots(sic_code = 85)