| Title: | Reads Raw Files from Li-COR Gas Analyzers |
|---|---|
| Description: | Reads raw files from Li-COR gas analyzers and produces a dataframe that can directly be used with 'fluxible' (Gaudard et al 2025 <doi:10.1111/2041-210X.70161>). |
| Authors: | Joseph Gaudard [aut, cre] (ORCID: <https://orcid.org/0000-0002-6989-7624>) |
| Maintainer: | Joseph Gaudard <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.3.0 |
| Built: | 2026-05-10 08:40:52 UTC |
| Source: | https://github.com/jogaudard/licoread |
to read the raw data
data_82z(filepath, data_file, data_name, gases, filename)data_82z(filepath, data_file, data_name, gases, filename)
filepath |
name and path to the 82z archive |
data_file |
name of the file with raw data |
data_name |
vector of colnames |
gases |
list of gases |
filename |
name of the 82z archive |
a long df with the actual data contained in the data file
create colnames for data tibble
data_name_82z(filepath, data_file)data_name_82z(filepath, data_file)
filepath |
name and path to the 82z archive |
data_file |
name of the file with raw data |
a character vector or the colnames of the data file
makes df from 81x files compatible with fluxible
fluxible_81x(df, focus_gas, id_cols, datetime_col)fluxible_81x(df, focus_gas, id_cols, datetime_col)
df |
input dataframe from licoread |
focus_gas |
gas to select |
id_cols |
columns to identify unique fluxes |
datetime_col |
column containing datetime information |
a df with the focus gas column renamed as "f_conc" and f_fluxid in chronological order of datetime
makes df from 82z files compatible with fluxible
fluxible_82z(df, focus_gas)fluxible_82z(df, focus_gas)
df |
input dataframe from licoread |
focus_gas |
gas to select |
an unnested df with only the selected gas
imports data from the li7500 setup described in Halbritter et al (2024)
import7500(path, version = "till2023", plotinfo = FALSE)import7500(path, version = "till2023", plotinfo = FALSE)
path |
location of the files. Note that the function is recursive and will import all the files at the location |
version |
|
plotinfo |
character vector of names to use when separating the
plot info from the file name. Names in the file name have to be separated
with an underscore, ex: |
a dataframe with all data present in the files to import. New
datetime and fluxid columns contain respectively the datetime of
measurements and their original filename. If comments are present, a column
will contain the comments. Measurement informations from the file
names are stored in new columns according to plotinfo.
Halbritter, A.H., Vandvik, V., Cotner, S.H. et al. Plant trait and vegetation data along a 1314 m elevation gradient with fire history in Puna grasslands, Perú. Sci Data 11, 225 (2024). https://doi.org/10.1038/s41597-024-02980-3
path_pftc7 <- system.file("extdata/pftc7", package = "licoread") import7500(path_pftc7, version = "post2023") path_pftc5 <- system.file("extdata/pftc5", package = "licoread") import7500(path_pftc5, plotinfo = c("site", "treatment", "date", "plot", "trial")) path_co2fluxtent <- system.file("extdata/co2fluxtent", package = "licoread") import7500(path_co2fluxtent, plotinfo = c("date", "location", "time_of_day", "trial"))path_pftc7 <- system.file("extdata/pftc7", package = "licoread") import7500(path_pftc7, version = "post2023") path_pftc5 <- system.file("extdata/pftc5", package = "licoread") import7500(path_pftc5, plotinfo = c("site", "treatment", "date", "plot", "trial")) path_co2fluxtent <- system.file("extdata/co2fluxtent", package = "licoread") import7500(path_co2fluxtent, plotinfo = c("date", "location", "time_of_day", "trial"))
imports one file from li7500 (old)
import7500_new_oneobs(filepath)import7500_new_oneobs(filepath)
filepath |
path to the file |
a df with the content of the file
imports one file from li7500 (old)
import7500_old_oneobs(filepath)import7500_old_oneobs(filepath)
filepath |
path to the file |
a df with the content of the file
reads Li-COR files in a given location
licoread( location, file_type = "auto", file_type_list = c("82z", "81x", "auto"), data_file = "data.csv", meta_file = "metadata.json", regex_file = "(\\w*-)*\\w*(?=([.]82z$))", sample = FALSE )licoread( location, file_type = "auto", file_type_list = c("82z", "81x", "auto"), data_file = "data.csv", meta_file = "metadata.json", regex_file = "(\\w*-)*\\w*(?=([.]82z$))", sample = FALSE )
location |
location of the files |
file_type |
type of file (82z or 81x). If "auto" (default), the function will try to detect it by itself. |
file_type_list |
list of file types |
data_file |
name of the file with raw data |
meta_file |
name of the file with meta data |
regex_file |
regex expression matching the name of the 82z file. Here in case the user has a different than the default and for easier updates. |
sample |
|
a tibble (nested or not depending on raw data) containing all the data from the raw files present at the location provided
path_82z <- system.file("extdata/82z", package = "licoread") licoread(path_82z)path_82z <- system.file("extdata/82z", package = "licoread") licoread(path_82z)
finds out the file type for licoread
licoread_auto(file_list)licoread_auto(file_list)
file_list |
list of files found in the location |
a single character string indicating the file type
selects the focus gas and checks the columns needed for the fluxible workflow
licoread_to_fluxible( df, focus_gas, datetime_col, id_cols = c("File Name", "Obs#"), file_type = "auto", file_type_list = c("82z", "81x", "auto") )licoread_to_fluxible( df, focus_gas, datetime_col, id_cols = c("File Name", "Obs#"), file_type = "auto", file_type_list = c("82z", "81x", "auto") )
df |
input dataframe from licoread |
focus_gas |
gas to select |
datetime_col |
column containing datetime information if date and time are in two different columns, provide a character vector of the form c("date", "time") |
id_cols |
columns to identify unique fluxes |
file_type |
type of file (82z or 81x). If "auto" (default), the function will try to detect it by itself. |
file_type_list |
list of file types |
an unnested df with only the selected gas
path_82z <- system.file("extdata/82z", package = "licoread") gas_df_82z <- licoread(path_82z) licoread_to_fluxible(gas_df_82z, "LI-7810_CH4_DRY", datetime_col = c("LI-8250_DATE", "LI-8250_TIME"))path_82z <- system.file("extdata/82z", package = "licoread") gas_df_82z <- licoread(path_82z) licoread_to_fluxible(gas_df_82z, "LI-7810_CH4_DRY", datetime_col = c("LI-8250_DATE", "LI-8250_TIME"))
prints a character vector of the gases present in the dataset. This is to be used to obtain the exact names of the gases before using licoread_to_fluxible.
list_gases(df, file_type = "auto", file_type_list = c("82z", "81x", "auto"))list_gases(df, file_type = "auto", file_type_list = c("82z", "81x", "auto"))
df |
the dataframe as imported with licoread |
file_type |
type of file (currently works only for 82z). If "auto" (default), the function will try to detect it by itself. |
file_type_list |
list of file types |
a character vector of the gases present in the dataset
path_82z <- system.file("extdata/82z", package = "licoread") gas_df_82z <- licoread(path_82z) list_gases(gas_df_82z)path_82z <- system.file("extdata/82z", package = "licoread") gas_df_82z <- licoread(path_82z) list_gases(gas_df_82z)
read meta data file inside 82z archive
metadata_82z(filepath, meta_file)metadata_82z(filepath, meta_file)
filepath |
name and path to the 82z archive |
meta_file |
name of the file with meta data |
a tibble with the metadata from one observation
to get a vector of names of a df, matching a regex
names_df(df, regname = "name\\d")names_df(df, regname = "name\\d")
df |
the df to get the names from |
regname |
the regex expression to match |
a df with the names of the meta df
reads a single measurement from a licor .81x file
oneobs_81x(start, end, all_obs, file)oneobs_81x(start, end, all_obs, file)
start |
line number at which the measurement starts |
end |
line number at which the measurement ends |
all_obs |
list of all the lines from the full file |
file |
filepath to the 81x files |
a df with 1 row with the meta data of the measurement and raw data nested
to read one measurement from the 82z archive
oneobs_82z(filepath, data_file, meta_file, regex_file)oneobs_82z(filepath, data_file, meta_file, regex_file)
filepath |
path to the 82z archive |
data_file |
name of the file with raw data |
meta_file |
name of the file with meta data |
regex_file |
regex expression matching the name of the 82z file. Here in case the user has a different than the default and for easier updates. |
a tibble with all the data and metadata from one observation (one file)
reads a .81x file with several measurements
read_81x_onefile(file)read_81x_onefile(file)
file |
filepath the the 81x file to read |
a nested tibble with the meta data from each measurements as row and the raw data nested
to create a nested tibble with the units of data
units_82z(filepath, data_file, data_name, filename)units_82z(filepath, data_file, data_name, filename)
filepath |
name and path to the 82z archive |
data_file |
name of the file with raw data |
data_name |
vector of colnames |
filename |
name of the 82z archive |
a tibble with the units of the variables contained in the raw data