Skip to contents

License: MITWebsite Website

SECFC (Survey-Embedded Carbon Footprint Calculator) is a transparent, open-source R package designed to assist researchers in environmental psychology with survey-based carbon footprint estimation.

It provides a modular structure that makes it easy to calculate and analyze emissions from various domains such as consumption, food, housing, transport, and pets.

SECFC is particularly suitable for academic studies requiring reproducibility, transparency, and process-level emissions output.

Shiny APP

Key Features

  • Twelve core functions to estimate individual-level carbon footprint based on survey data.
  • ️ Transparent processing: Choose between total emissions or detailed calculation steps.
  • Designed with survey data structure in mind.
  • Ideal for environmental psychology, behavioral science, and carbon impact studies.

️ Functions Overview

SECFC contains twelve main functions, divided into two groups:

➤ Simple Output Functions

These functions calculate total emissions by domain and produce a new data frame in your R environment named by appending a suffix to the input object’s name:

Each function:

  1. Accepts a data frame (e.g. data) as input.
  2. Computes the specified emissions.
  3. Assigns the result to a new object in your workspace (e.g. data_cons, data_food, etc.).
  4. Prints a confirmation message, for example: When you call the function calc_cons_emissions(data), it will print: ✅ A new data frame ‘data_cons’ is now available in your R environment.

➤ Process-Level Functions

These functions provide detailed emissions breakdowns, producing a new data frame in your R environment by appending a suffix to the input name:

Each function:

  1. Takes a data frame as input.
  2. Appends multiple columns showing intermediate calculation steps.
  3. Returns the detailed data frame.
  4. Prints a confirmation message.

Example Usage

Here’s a simple example of how to use the SECFC package in practice:

# Step 1: Load the package
library(SECFC)

# Step 2: Load your dataset
# Example: use "questionnaire_sample.rds"
df <- readRDS("questionnaire_sample.rds")

# Step 3: Calculate carbon emissions by domain
calc_cons_emissions(df)       # Calculates consumption emissions
calc_food_emissions(df)       # Calculates food emissions
calc_housing_emissions(df)    # Calculates housing emissions
calc_pet_emissions(df)        # Calculates pet emissions
calc_transport_emissions(df)  # Calculates transport emissions

# Step 4: Calculate total carbon footprint
calc_total_emissions(df)

# Optional: Use process-level functions to view detailed steps
calc_cons_emissions_process(df)
calc_food_emissions_process(df)
calc_housing_emissions_process(df)
calc_pet_emissions_process(df)
calc_transport_emissions_process(df)
calc_total_emissions_process(df)

📫 Contact

For questions, bug reports, or suggestions, please reach out to:

Jianing Ding

Tongji University

Ka Leung Lam

Duke Kunshan University

Nathaniel Geiger

University of Michigan

Ziqian Xia

Stanford University

Jinliang Xie

Tsinghua University