flux_match: Matching continuously measured fluxes with measurement IDs...

View source: R/flux_match.R

flux_matchR Documentation

Matching continuously measured fluxes with measurement IDs and meta data

Description

Matching a dataframe of continuously measured gas concentration data with measurement metadata from another dataframe. Measurements are paired with their metadata based on datetime. Extra variables in both dataframes are kept in the output.

Usage

flux_match(
  raw_conc,
  field_record,
  f_datetime,
  start_col,
  end_col,
  measurement_length,
  fixed_length = deprecated(),
  time_diff = 0,
  startcrop = 0,
  ratio_threshold = deprecated(),
  f_conc = deprecated()
)

Arguments

raw_conc

dataframe of CO2 concentration measured continuously. Has to contain at least a datetime column in ymd_hms format and a gas concentration column as double.

field_record

dataframe recording which measurement happened when. Has to contain at least a column containing the start of each measurement, and any other column identifying the measurements.

f_datetime

datetime column in raw_conc (ymd_hms format)

start_col

start column in field_record (ymd_hms format)

end_col

end column in field_record (ymd_hms format), if present (see measurement_length).

measurement_length

length of the measurements (in seconds) from the start specified in the field_record. Use measurement_length if all the measurements have the same length and no end column is present in field_record.

fixed_length

[Deprecated] no longer required. flux_match will detect if end_col or measurement_length are provided.

time_diff

time difference (in seconds) between the two datasets. Will be added to the datetime column of the raw_conc dataset. For situations where the time was not synchronized correctly.

startcrop

[Deprecated] startcrop is no longer supported. Please use start_cut in flux_fitting instead.

ratio_threshold

[Deprecated] ratio_threshold is no longer supported. Please use ratio_threshold in flux_quality instead.

f_conc

[Deprecated] f_conc is no longer required

Details

If both end_col and measurement_length are provided, end_col will be ignored. Measurements either all have the same length (provide measurement_length), or the length varies and end_col has to be provided.

Value

a dataframe with concentration measurements, corresponding datetime, flux ID (f_fluxid), measurements start (f_start) and end (f_end).

Examples

data(co2_df_short, record_short)
flux_match(co2_df_short, record_short, datetime, start,
measurement_length = 180)

fluxible documentation built on Sept. 12, 2025, 1:08 a.m.