Prediction entry point for batch SME and agriculture emissions

batch_predict_emissions(data, company_type, output_path = NULL)

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.

company_type

A single parameter "sme" or "farm" to determine which emission prediction funtions to call.

output_path

Optional file path to save the results as a CSV. If NULL, results are not saved to a file.

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, company_type = "sme", output_path = NULL)
#>                  company_name sic_code turnover sme_scope1 sme_scope2
#> 1 Abdur's Abnormal Algorithms       87  3098836   200.8262   91.43155
#> 2      Ajit's Jetpack Rentals       88 20500387   454.1878  247.27183
#> 3     Alex's Axolotl Emporium       74 13297747   111.3805   65.14319