Prediction entry point for batch SME and agriculture emissions

batch_predict_emissions(data, output_path = NULL, company_type = "sme")

Arguments

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").

Value

A data frame with input columns and predicted emissions for each scope (in tCo2e). Optionally saved to a CSV file.

Examples

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")
#>                  company_name sic_code turnover sme_scope1 sme_scope2
#> 1 Abdur's Abnormal Algorithms       87  3098836     200.96      91.42
#> 2      Ajit's Jetpack Rentals       88 20500387     461.42     250.39
#> 3     Alex's Axolotl Emporium       74 13297747     110.66      64.93
#>   sme_scope3
#> 1    2722.00
#> 2    4001.59
#> 3   11965.83