calculate_regression {aelab}R Documentation

calculate_regression

Description

Calculate the slope of greenhouse gas (GHG) concentration change over time using simple linear regression.

Usage

calculate_regression(
  data,
  ghg,
  reference_time,
  duration_minutes = 7,
  num_rows = 300
)

Arguments

data

Data from the LI-COR Trace Gas Analyzer that has been processed and time-converted.

ghg

Column name of the file containing data on GHG concentration (e.g., "CH4", "N2O").

reference_time

The date and time at which the measurement started.

duration_minutes

The duration of the measurement, default to 7.

num_rows

The number of rows used to perform the regression, default to 300.

Value

A tibble containing the time range (POSIXct format) of the slope and R2 (both numeric) from the simple linear regression.

Examples

data(n2o)
calculate_regression(n2o, "N2O", as.POSIXct("2023-05-04 09:16:15", tz = "UTC"))

[Package aelab version 0.4.0 Index]