knitr::opts_chunk$set( collapse = TRUE, comment = "#>", warning = FALSE, message = FALSE )
This vignette provides a practical, end-to-end introduction to cowfootR. It is intended for new users who want to understand the core workflow of the package and obtain a first carbon footprint estimate for a dairy farm.
The focus is on: - understanding the workflow - knowing which functions to call and in what order - seeing actual outputs produced by the package
More detailed explanations of parameters, methodological choices, and advanced use cases are covered in the other vignettes.
cowfootR estimates greenhouse gas (GHG) emissions from dairy farms following IPCC (2019) and IDF (2022) guidelines.
The package: - calculates emissions by source - aggregates them into total farm emissions - computes intensity metrics per unit of milk or land - supports single-farm and batch (multi-farm) analysis
The standard workflow is: 1- Define system boundaries 2- Calculate emissions by source 3- Aggregate total emissions 4- Calculate intensity metrics
This vignette walks through these steps using a minimal example.
install.packages("cowfootR")
Or install the development version:
devtools::install_github("juanmarcosmoreno-arch/cowfootR")
Load the package:
library(cowfootR)
System boundaries determine which emission sources are included in the assessment.
The most common option is "farm_gate", which includes on-farm emissions only.
boundaries <- set_system_boundaries("farm_gate") boundaries
Other options (e.g. "cradle_to_farm_gate") are described in the Workflow overview vignette.
Unless otherwise stated, cowfootR reports: - Absolute emissions as annual farm totals in kg CO₂eq per year (kg CO₂eq yr⁻¹), within the selected system boundaries. - Milk intensity as kg CO₂eq per kg FPCM (FPCM computed following IDF). - Area intensity as kg CO₂eq per hectare (kg CO₂eq ha⁻¹ yr⁻¹).
Each emission source is calculated using a dedicated function. All functions return structured objects with emissions expressed in kg CO₂eq.All functions return structured objects with emissions expressed as kg CO₂eq yr⁻¹ (annual totals), unless stated otherwise.
Enteric fermentation accounts for methane (CH₄) produced during ruminal digestion.
enteric <- calc_emissions_enteric( n_animals = 100, cattle_category = "dairy_cows", boundaries = boundaries ) enteric
This includes CH₄ and N₂O emissions from manure handling systems.
manure <- calc_emissions_manure( n_cows = 100, boundaries = boundaries ) manure
Soil emissions mainly originate from nitrogen inputs such as fertilizers and excreta deposited during grazing.
soil <- calc_emissions_soil( n_fertilizer_synthetic = 1500, n_excreta_pasture = 5000, area_ha = 120, boundaries = boundaries ) soil
Energy-related emissions come from fuel combustion and electricity consumption.
energy <- calc_emissions_energy( diesel_l = 2000, electricity_kwh = 5000, boundaries = boundaries ) energy
This category includes emissions embodied in feeds, fertilizers, and materials.
inputs <- calc_emissions_inputs( conc_kg = 1000, fert_n_kg = 500, boundaries = boundaries ) inputs
All emission sources are combined using calc_total_emissions().
total_emissions <- calc_total_emissions( enteric, manure, soil, energy, inputs ) total_emissions
Intensity metrics relate total emissions to production or land use.
Emissions per unit of milk are expressed as kg CO₂eq per kg of fat- and protein-corrected milk (FPCM).
milk_intensity <- calc_intensity_litre( total_emissions = total_emissions, milk_litres = 750000, fat = 4.0, protein = 3.3 ) milk_intensity
Emissions per hectare are useful for land-based comparisons.
area_intensity <- calc_intensity_area( total_emissions = total_emissions, area_total_ha = 120 ) area_intensity
In most dairy systems: - Enteric fermentation is the largest emission source - Inputs and soils are often the second-largest contributors - Energy use typically represents a smaller share
Results should always be interpreted considering: - data quality - system boundaries - production system characteristics
This vignette covered the minimum workflow needed to use cowfootR.
Next steps: - See Introduction to Dairy Life Cycle Assessment for conceptual background - See Single Farm Analysis for a more detailed example - See Complete Parameter Reference Guide for full parameter documentation - See Workflow overview for batch processing and reporting
- cowfootR follows a modular, step-by-step workflow - Each emission source is calculated independently - Results can be expressed as total emissions or intensities - This vignette provides a starting point; advanced topics are covered elsewhere
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.