Learn R Programming

carbonpredict (version 2.0.1)

batch_predict_emissions: Batch Predict Emissions

Description

Prediction entry point for batch SME and Farms emissions

Usage

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

Value

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

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

Examples

Run this code
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")

Run the code above in your browser using DataLab