flux_match {fluxible} | R 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,
startcrop = 10,
measurement_length = 220,
ratio_threshold = 0.5,
time_diff = 0,
datetime_col = "datetime",
conc_col = "conc",
start_col = "start"
)
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. |
startcrop |
how many seconds should be discarded at the beginning of the measurement |
measurement_length |
length of the measurement (in seconds) from the start specified in the field_record |
ratio_threshold |
ratio (number of concentration measurement compared to length of measurement in seconds) below which the data should be flagged as too little |
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. |
datetime_col |
datetime column in raw_conc (dmy_hms format) |
conc_col |
concentration column in raw_conc |
start_col |
start column in field_record (dmy_hms format) |
Value
a dataframe with concentration measurements, corresponding datetime, flux ID, measurements start and end, flags in case of no data or low number of data, and any variables present in one of the inputs.
Examples
data(co2_df_short, record_short)
flux_match(co2_df_short, record_short)