Learn R Programming

aelab (version 1.1.1)

calculate_ghg_flux: calculate_ghg_flux

Description

Calculate the greenhouse gas (GHG) flux based on input parameters from a data frame.

Usage

calculate_ghg_flux(
  data,
  slope = "slope",
  area = "area",
  volume = "volume",
  temp = "temp"
)

Value

A list containing the calculated flux and its unit.

Arguments

data

A data frame containing relevant data with columns for slope, area, volume, and temperature.

slope

Name of the column in `data` that contains the slope values of the GHG concentration change (in ppm/s).

area

Name of the column in `data` that contains the values of the area of the chamber (in square meter).

volume

Name of the column in `data` that contains values of the volume of the chamber (in litre).

temp

Name of the column in `data` that contains values of the temperature of the gas (in Celsius).

Examples

Run this code
data <- data.frame(
  slope = c(1.2, 1.5, 1.1),
  area = c(100, 150, 120),
  volume = c(10, 15, 12),
  temp = c(25, 30, 22)
)
results <- calculate_ghg_flux(data)
print(results)

Run the code above in your browser using DataLab