import2RData(
path,
instrument,
date.format,timezone = "UTC",
keep_all,
prec,
... )
Import raw data
The package contains a wide range of functions that let the user import raw data from a variety of instruments:
- LI-COR trace gas analyzers: LI-6400 for CO2 and H2O, LI-7810 for CO2, CH4 and H2O, LI-7820 for N2O and H2O, and LI-8100 for CO2 and H2O
- LI-COR Smart Chamber: for an easy import of data from any gas analyzer
- Los Gatos Research (ABB) laser gas analyzers: Ultra-portable Greenhouse Gas Analyzer (UGGA; GLA132 series), Microportable Greenhouse Gas Analyzer (MGGA; GLA131 series) for CO2, CH4 and H2O, and GLA151-N2OM1 for N2O, CH4 and H2O
- Picarro G2508 Gas Concentration Analyzer: for CO2, CH4, N2O, NH3 and H2O
- Picarro GasScouterTM G4301 Mobile Gas Concentration Analyzer: for CO2, CH4 and H2O
- GAIATECH Automated ECOFlux chamber: for an easy import of data from any gas analyzer
- Gasmet DX4015 portable analyzer for humid conditions: for CO, CO2, CH4, N2O, NH3 and H2O
- PP-Systems EGM-5 Portable CO2 Gas Analyzer: for CO2, O2 and H2O
- Aeris Technologies MIRA Ultra Gas Analyzers: for N2O, CO2 and H2O or for CH4, C2H6 and H2O
There are two ways to import raw data files into R:
- Import all files contained in a folder using the function
import2RData
. - Import single files using a function unique to each instrument.
import2RData
Import all raw gas measurement files contained in a folder using the function import2RData
. Adapted to multiple greenhouse gas analyzers and other instruments:
- LI-COR: LI-6400, LI-7810, LI-7820, LI-8100, LI-8200 (smart chamber)
- Los Gatos Research (LGR): ultra-portable GGA (GLA132 series), micro ultra-portable GGA (GLA131 series) and N2OM1 (GLA151 series)
- GAIA2TECH (DMR) automated chamber ECOFlux
- Picarro: G2508 and G4301
- Gasmet: DX4015
- PP-Systems: EGM-5
- Aeris Technologies: N2O/CO2 high accuracy analyzer and CH4/C2H6 natural gas detection system
Usage
Code chunks under Usage sections are not part of the demonstration. They are meant to show you how to use the arguments in the function.
Arguments
path |
character string; a folder path containing all files to be imported. Ideally, to avoid any errors, the folder should only contain the files to be imported. |
instrument |
character string; specifies which instrument was used to generate the files contained in the folder path. Choose one of the following: “DX4015”, “EGM5”, “G2508”, “G4301” “GAIA”, “LI-6400”, “LI-7810”, “LI-7820”, “LI-8100”, “LI-8200”, “UGGA” or “N2OM1”. For more information about an instrument, see the section “See Also” below. |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas. Look at the examples below, or the help for each import function of each instrument, to know what values to use. |
proc.data.field |
numeric value; select the process data field used with the EGM-5. There are 5 different modes available: (1) Measure mode; (2) SRC or Custom mode; (3) CPY mode; (4) Injection mode; or (5) Static mode. If no value is specified, the parameters will be named “param1”, “param2”, “param3”, “param4” and “param5”. |
pivot |
character string; either “long” or “wide”. If pivot = "long" , each column containing information about Tsoil , Tcham , SWC , PAR and operating status (Op.stat ) will be saved in a single column per parameter. If pivot = "wide" , the default display of one column per chamber per parameter will be used. |
active |
logical; if active = TRUE , preserve data for active chambers only. |
flag |
numeric vector; indicates the operating status that should be used for the flux calculation. Default is flag = c(7,11) , where 7 indicates “Chamber Idle Closed Clear” and 11 indicates “Chamber Idle Closed Dark”. |
background |
logical; if background = FALSE , removes all data from activ.cham == "Background" . |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
Op.stat.col , PAR.col , Tcham.col , Tsoil.col , SWC.col , CH.col |
character string; a pattern to match all columns that fit the corresponding parameter. For example, all columns containing the pattern “3C07_Sunlight” will be renamed with the pattern “_PAR”. Then, if pivot = "long" , all columns with the pattern “_PAR” will be merged together. |
CO2.col , CH4.col , H2O1.col , N2O.col , H2O2.col |
character string; a pattern to match the columns containing the corresponding gas measurements. H2O1.col must be the same instrument as CO2.col and CH4.col , and H2O2.col must be the same instrument as N2O.col . |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For most instruments, the date is one of the columns in the raw data file:
- DX4015: column Date
- EGM5: column Date
- G2508: column DATE
- G4301: column DATE
- GAIA: column Titles:
- UGGA: column Time
- LI-6400: (see comment below)
- LI-7810: column DATE
- LI-7820: column DATE
- LI-8100: column Date
- LI-8200: (see comment below)
- N2OM1: column Time
- uCH4: column Time Stamp
- uN2O: column Time Stamp
For the instrument LI-6400, the date is found in one of the first lines in a format containing abbreviations, for example “Thr Aug 6 2020”, which would be the date format “mdy”. For the instrument LI-8200, the date is found under one of the measurements, next to ‘“Date”:’.
The argument proc.data.field
is used with the PP-Sytems EGM-5 instrument only. Look up the EGM-5 Operation Manual at page 90 for more details about the different Process Data Fields (proc.data.field
).
The arguments active
, pivot
, flag
, backgroun
, CH.col
, PAR.col
, Tcham.col
, Tsoil.col
, SWC.col
, Op.stat.col
, CO2.col
, CH4.col
, H2O1.col
, N2O.col
, H2O2.col
, are used in the function import.GAIA
only.
Examples
All files contained in the folder path specified are saved in a newly created folder “RData” in your working directory.
In all examples, an example file from the package goFlux
is retrieved using the function system.file
to be used in the example. However, to use the function with your own data, the argument path
must be the folder path containing your files:
import2RData(path = "your_raw_data_folder", instrument = "DX4015",
date.format = "ymd", keep_all = FALSE,
prec = c(1.6, 23, 13, 2, 23, 33))
Gasmet
DX4015
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/DX4015", package = "goFlux")
file.path import2RData(path = file.path, instrument = "DX4015",
date.format = "ymd", keep_all = FALSE,
prec = c(1.6, 23, 13, 2, 23, 33))
PP-Systems
EGM-5
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/EGM5", package = "goFlux")
file.path # The argument proc.data.field is used with the PP-System EGM-5 instrument only.
import2RData(path = file.path, instrument = "EGM5",
date.format = "dmy", keep_all = FALSE,
prec = c(3, 1, 500), proc.data.field = 2)
Picarro
G2508
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/G2508", package = "goFlux")
file.path import2RData(path = file.path, instrument = "G2508",
date.format = "ymd", keep_all = FALSE,
prec = c(0.24, 0.3, 5, 0.16, 500))
G4301
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/G4301", package = "goFlux")
file.path import2RData(path = file.path, instrument = "G4301",
date.format = "ymd", keep_all = FALSE,
prec = c(0.025, 0.1, 10))
GAIA2TECH
Automated chamber ECOFlux
Note that with this instrument, keep_all
is not a valid argument.
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/GAIA", package = "goFlux")
file.path import2RData(path = file.path, instrument = "GAIA",
date.format = "ymd", prec = c(3.5, 0.6, 0.4, 45, 45))
LGR
UGGA (GLA132 series)
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/UGGA", package = "goFlux")
file.path import2RData(path = file.path, instrument = "UGGA",
date.format = "dmy", keep_all = FALSE,
prec = c(0.2, 1.4, 50))
MGGA (GLA131 series)
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/UGGA", package = "goFlux")
file.path import2RData(path = file.path, instrument = "UGGA",
date.format = "dmy", keep_all = FALSE,
prec = c(0.35, 0.9, 200))
N2OM1 (GLA151 series)
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/N2OM1", package = "goFlux")
file.path import2RData(path = file.path, instrument = "N2OM1",
date.format = "dmy", keep_all = FALSE,
prec = c(0.5, 2, 50))
LI-COR
LI-6400
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/LI6400", package = "goFlux")
file.path import2RData(path = file.path, instrument = "LI-6400",
date.format = "mdy", keep_all = FALSE,
prec = c(0.15, 20))
LI-7810
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/LI7810", package = "goFlux")
file.path import2RData(path = file.path, instrument = "LI-7810",
date.format = "ymd", keep_all = FALSE,
prec = c(3.5, 0.6, 45))
LI-7820
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/LI7820", package = "goFlux")
file.path import2RData(path = file.path, instrument = "LI-7820",
date.format = "ymd", keep_all = FALSE,
prec = c(0.4, 45))
LI-8100
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/LI8100", package = "goFlux")
file.path import2RData(path = file.path, instrument = "LI-8100",
date.format = "ymd", keep_all = FALSE,
prec = c(1, 10))
Smart Chamber (LI-8200)
Note that with this instrument, keep_all
and prec
are not valid arguments.
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/LI8200", package = "goFlux")
file.path import2RData(path = file.path, instrument = "LI-8200",
date.format = "ymd")
Aeris Technologies
MIRA Ultra CH4/ C2H6 analyzer
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/uCH4", package = "goFlux")
file.path import2RData(path = file.path, instrument = "uCH4",
date.format = "mdy", keep_all = FALSE,
prec = c(1, 0.5, 15))
MIRA Ultra N2O/ CO2 analyzer
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata/uN2O", package = "goFlux")
file.path import2RData(path = file.path, instrument = "uN2O",
date.format = "mdy", keep_all = FALSE,
prec = c(0.2, 0.2, 15))
Single file import
Each instrument has a unique function for single file import. The advantage of using this function is that a file can be saved in the environment in an object instead of being saved as an .RData file in the working directory. Just like the import2RData
function, there is a function adapted to multiple greenhouse gas analyzers and other instruments:
- LI-COR: LI-6400, LI-7810, LI-7820, LI-8100, LI-8200 (smart chamber)
- Los Gatos Research (LGR): ultra-portable GGA (GLA132 series) and micro ultra-portable GGA (GLA131 series)
- GAIA2TECH (DMR) automated chamber ECOFlux
- Picarro: G2508 and G4301
- Gasmet: DX4015
- PP-Systems: EGM-5
- Aeris Technologies: N2O/CO2 high accuracy analyzer and CH4/C2H6 natural gas detection system
Gasmet
DX4015
Import single raw gas measurement files from the Gasmet DX4015 gas analyzer (CO, CO2, CH4, N2O, NH3 and H2O) with the function import.DX4015
.
Usage
import.DX4015(
inputfile,date.format = "ymd",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(1.6, 23, 13, 2, 23, 33)
)
Arguments
inputfile |
character string; the name of a file with the extension .TXT |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “ymd”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “CO2dry_ppm”, “COdry_ppb”, CH4dry_ppb”, “N2Odry_ppb”, “NH3dry_ppb” and H2O_ppm”. The default is prec = c(1.6, 23, 13, 2, 23, 33) . |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For the instrument DX4015, the date is found in the column “Date”.
Note that this function was designed for the following units in the raw file:
- ppm for CO2, CO, CH4, N2O and NH3
- vol-% for H2O
- mbar for pressure
- Celsius for temperature
If your Gasmet DX4015 uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm for CO2 and H2O, or 1 ppb for CH4, CO N2O and NH3) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones provided by the manufacturer upon request, for the latest model of this instrument available at the time of the creation of this function (11-2023).
Example
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "DX4015/DX4015.TXT", package = "goFlux")
file.path
# Import in the environment
<- import.DX4015(inputfile = file.path)
imp.DX4015
# Or save in a RData folder in the working directory
import.DX4015(inputfile = file.path, save = TRUE)
PP-Systems
EGM-5
Import single raw gas measurement files from the PP-Systems EGM-5 Portable CO2 Gas Analyzer, with the function import.EGM5
.
Usage
import.EGM5(
inputfile,date.format = "dmy",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(3, 1, 500),
proc.data.field = NULL
)
Arguments
inputfile |
character string; the name of a file with the extension .TXT |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “dmy”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “CO2dry_ppm”, “O2dry_pct” and H2O_ppm”. The default is prec = c(3, 1, 500) . |
proc.data.field |
numeric value; select the process data field used with the EGM-5. There are 5 different modes available: (1) Measure mode; (2) SRC or Custom mode; (3) CPY mode; (4) Injection mode; or (5) Static mode. If no value is specified, the parameters will be named “param1”, “param2”, “param3”, “param4” and “param5”. |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For the instrument EGM5, the date is found in the column “Date”.
Note that this function was designed for the following units in the raw file:
- ppm for CO2
- % for O2 (pct)
- mb for H2O
- mb for pressure
- Celsius for temperature
If your PP-Systems EGM-5 uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm for CO2 and H2O, or 1% for O2) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones provided by the manufacturer upon request, for the latest model of this instrument available at the time of the creation of this function (11-2023).
Look up the EGM-5 Operation Manual at page 90 for more details about the different Process Data Fields (proc.data.field
).
Note that the default file extension for this instrument is .TXT, however, it is also possible to use with a .csv file format.
Example
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "EGM5/EGM5.TXT", package = "goFlux")
file.path
# Import in the environment
<- import.EGM5(inputfile = file.path)
imp.EGM5
# Or save in a RData folder in the working directory
import.EGM5(inputfile = file.path, save = TRUE)
Picarro
G2508
Import single raw gas measurement files from the Picarro G2508 (CO2, CH4, N2O, NH3, and H2O GHG analyzer) with the function import.G2508
.
Usage
import.G2508(
inputfile,date.format = "ymd",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(0.24, 0.3, 5, 0.16, 500)
)
Arguments
inputfile |
character string; the name of a file with the extension .dat |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “ymd”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “CO2dry_ppm”, CH4dry_ppb”, “N2Odry_ppb”, “NH3dry_ppb” and H2O_ppm”. The default is prec = c(0.24, 0.3, 5, 0.16, 500) . |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For the instrument G2508, the date is found in the column “DATE”.
Note that this function was designed for the following units in the raw file:
- ppm for CO2
- ppb for CH4, N2O and NH3
- mmol/mol for H2O
- Torr for pressure
- Celsius for temperature
If your Picarro G2508 uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm for CO2 and H2O, or 1 ppb for CH4, N2O and NH3) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones found online for the latest model of this instrument, available at the time of the creation of this function (11-2023).
Example
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "G2508/2022/08/01/G2508.dat", package = "goFlux")
file.path
# Import in the environment
<- import.G2508(inputfile = file.path)
imp.G2508
# Or save in a RData folder in the working directory
import.G2508(inputfile = file.path, save = TRUE)
G4301
Import single raw gas measurement files from the Picarro G4301 (CO2, CH4 and H2O GHG analyzer) with the function import.G4301
.
Usage
import.G4301(
inputfile,date.format = "ymd",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(0.025, 0.1, 10)
)
Arguments
inputfile |
character string; the name of a file with the extension .dat |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “ymd”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “CO2dry_ppm”, CH4dry_ppb” and H2O_ppm”. The default is prec = c(0.025, 0.1, 10) . |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For the instrument G4301, the date is found in the column “DATE”.
Note that this function was designed for the following units in the raw file:
- ppm for CO2
- ppb for CH4
- mmol/mol for H2O
- Torr for pressure
- Celsius for temperature
If your Picarro G4301 uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm for CO2 and H2O, or 1 ppb for CH4) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones found online for the latest model of this instrument, available at the time of the creation of this function (11-2023).
Example
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "G4301/G4301.dat", package = "goFlux")
file.path
# Import in the environment
<- import.G4301(inputfile = file.path)
imp.G4301
# Or save in a RData folder in the working directory
import.G4301(inputfile = file.path, save = TRUE)
GAIATECH
Automated chamber ECOFlux
Import single raw gas measurement files from the automated chamber ECOFlux (GAIA2TECH) (LI-7810: CO2, CH4 and H2O / LI7820: N2O and H2O) with the function import.GAIA
.
Usage
import.GAIA(
inputfile,date.format = "ymd",
timezone = "UTC",
pivot = "long",
active = TRUE,
flag = c(7, 11),
background = FALSE,
save = FALSE,
prec = c(3.5, 0.6, 0.4, 45, 45),
CH.col = "COM5A0",
SWC.col = "1C08_Soil.Moisture",
Tsoil.col = "1C07_Soil.Temperature",
Tcham.col = "2C07_Chamber.Temperature",
PAR.col = "3C07_Sunlight",
Op.stat.col = "0C06_OperatingStatus",
CO2.col = "XT2C05_CO2",
CH4.col = "XT2C04_CH4",
H2O1.col = "XT2C06_H2O",
N2O.col = "XT3C04_N2O",
H2O2.col = "XT3C05_H2O"
)
Arguments
inputfile |
character string; the name of a file with the extension .csv |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “ymd”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
pivot |
character string; either “long” or “wide”. If pivot = "long" , each column containing information about Tsoil , Tcham , SWC , PAR and operating status (Op.stat ) will be saved in a single column per parameter. If pivot = "wide" , the default display of one column per chamber per parameter will be used. |
active |
logical; if active = TRUE , preserve data for active chambers only. |
flag |
numeric vector; indicates the operating status that should be used for the flux calculation. Default is flag = c(7,11) , where 7 indicates “Chamber Idle Closed Clear” and 11 indicates “Chamber Idle Closed Dark”. |
background |
logical; if background = FALSE , removes all data from activ.cham == "Background" . |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “CO2dry_ppm”, CH4dry_ppb”, “N2Odry_ppb” “H2O_ppm_LI7810” and “H2O_ppm_LI7820”. The default is prec = c(3.5, 0.6, 0.4, 45, 45) . |
Op.stat.col , PAR.col , Tcham.col , Tsoil.col , SWC.col , CH.col |
character string; a pattern to match all columns that fit the corresponding parameter. For example, all columns containing the pattern “3C07_Sunlight” will be renamed with the pattern “_PAR”. Then, if pivot = "long" , all columns with the pattern “_PAR” will be merged together. |
CO2.col , CH4.col , H2O1.col , N2O.col , H2O2.col |
character string; a pattern to match the columns containing the corresponding gas measurements. H2O1.col must be the same instrument as CO2.col and CH4.col , and H2O2.col must be the same instrument as N2O.col . |
Details
This function has been designed for the automated chamber ECOFlux (GAIA2TECH) synced with up to 9 chambers and two GHG analyzers from LI-COR (LI-7810: CO2, CH4 and H2O / LI7820: N2O and H2O). If this function could be useful for you, but does not meet your needs, please contact the maintainer of this package for potential adaptations.
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For the instrument GAIA the date is found in the column “Titles:”.
The arguments PAR.col
, Tcham.col
, Tsoil.col
and SWC.col
correspond to different types of probes linked to the ECOFlux chamber: PAR, chamber temperature, soil temperature and soil water content volumetric, respectively. The argument Op.stat.col
corresponds to the columns Operating Status of each chamber. The argument CH.col
indicates a character string preceding the chamber number for each column of the raw data. For example, the column “COM5A011C06_OperatingStatus” in the raw data file contains the Operating Status for the chamber 1 if CH.col = "COM5A0"
and Op.stat.col = "1C06_OperatingStatus"
. If columns are absent from the raw data, the arguments are ignored.
Note that this function was designed for the following units in the raw file:
- ppm for CO2 and H2O
- ppb for CH4 and N2O
- kPa for pressure
- volumetric water content (%) for soil moisture
- Celsius for temperature
- µmol photons m-2s-1 for PAR
If your LI-COR instruments (LI-7810 and LI-7820) use different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
As opposed to the other import functions, there is no option to “keep_all” with this instrument. If you would like to import additional data using this function, please contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm for CO2 and H2O, or 1 ppb for CH4 and N2O) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones found online for the latest models of the LI-7810 and LI-7820, available at the time of the creation of this function (11-2023).
Example
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "GAIA/GAIA.csv", package = "goFlux")
file.path
# Import in the environment
<- import.GAIA(inputfile = file.path)
imp.GAIA
# Or save in a RData folder in the working directory
import.GAIA(inputfile = file.path, save = TRUE)
LGR
UGGA and MGGA
Import single raw gas measurement files from the ultra-portable GHG analyzers (GLA132-UGGA and GLA131-MGGA) from Los Gatos Research (CO2, CH4 and H2O) with the function import.UGGA
.
Usage
import.UGGA(
inputfile,date.format = "dmy",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(0.2, 1.4, 50)
)
Arguments
inputfile |
character string; the name of a file with the extension .txt |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “dmy”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “CO2dry_ppm”, CH4dry_ppb” and H2O_ppm”. The default is prec = c(0.2, 1.4, 50) , which corresponds to the ultra-portable GGA (GLA132 series). For the micro ultra-portable GGA (GLA131 series), use prec = c(0.35, 0.9, 200) . |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For these instruments, the date is found in the column “Time”.
Note that this function was designed for the following units in the raw file:
- ppm for CO2, CH4 and H2O
- Torr for pressure
- Celsius for temperature
If your LGR instrument (UGGA or MGGA) uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm for CO2 and H2O, or 1 ppb for CH4) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones found online for the latest model of this instrument available at the time of the creation of this function (11-2023).
Examples
UGGA (GLA132 series)
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "UGGA/UGGA.txt", package = "goFlux")
file.path
# Import in the environment
<- import.UGGA(inputfile = file.path, prec = c(0.2, 1.4, 50))
imp.UGGA
# Or save in a RData folder in the working directory
import.UGGA(inputfile = file.path, prec = c(0.2, 1.4, 50), save = TRUE)
MGGA (GLA131 series)
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "UGGA/UGGA.txt", package = "goFlux")
file.path
# Import in the environment
<- import.UGGA(inputfile = file.path, prec = c(0.35, 0.9, 200))
imp.MGGA
# Or save in a RData folder in the working directory
import.UGGA(inputfile = file.path, prec = c(0.35, 0.9, 200), save = TRUE)
N2OM1
Import single raw gas measurement files from the N2OM1 GHG analyzers (GLA151 series) from Los Gatos Research (N2O, CH4 and H2O) with the function import.N2OM1
.
Usage
import.N2OM1(
inputfile,date.format = "dmy",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(0.5, 2, 50)
)
Arguments
inputfile |
character string; the name of a file with the extension .txt |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “dmy”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “N2Odry_ppb”, CH4dry_ppb” and H2O_ppm”. The default is prec = c(0.5, 2, 50) . |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For the instrument N2OM1, the date is found in the column “Time”.
Note that this function was designed for the following units in the raw file:
- ppm for N2O, CH4 and H2O
- Torr for pressure
- Celsius for temperature
If your LGR N2OM1 instrument uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm for H2O, or 1 ppb for N2O and CH4) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones found online for the latest model of this instrument available at the time of the creation of this function (12-2023).
Example
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "N2OM1/N2OM1.txt", package = "goFlux")
file.path
# Import in the environment
<- import.N2OM1(inputfile = file.path, prec = c(0.5, 2, 50))
imp.N2OM1
# Or save in a RData folder in the working directory
import.N2OM1(inputfile = file.path, prec = c(0.5, 2, 50), save = TRUE)
LI-COR
LI-6400
Import single raw gas measurement files from the LI-COR 6400 (CO2 and H2O GHG analyzer) with the function import.LI6400
.
Usage
import.LI6400(
inputfile,date.format = "mdy",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(0.15, 20)
)
Arguments
inputfile |
character string; the name of a file with the extension .txt |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “mdy”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “CO2dry_ppm” and H2O_ppm”. The default is prec = c(0.15, 20) . |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For the instrument LI-6400, the date is found in one of the first lines in a format containing abbreviations, for example “Thr Aug 6 2020”, which would be the date format “mdy”.
Note that this function was designed for the following units in the raw file:
- ppm for CO2
- mmol/mol for H2O
- kPa for pressure
- cm3 for volumes
- Celsius for temperature
- µmol photons m-2s-1 for PAR
If your LI-COR LI-6400 uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones provided by the manufacturer upon request, for the latest model of this instrument available at the time of the creation of this function (11-2023).
Example
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "LI6400/LI6400.txt", package = "goFlux")
file.path
# Import in the environment
<- import.LI6400(inputfile = file.path)
imp.LI6400
# Or save in a RData folder in the working directory
import.LI6400(inputfile = file.path, save = TRUE)
LI-7810
Import single raw gas measurement files from the LI-COR 7810 (CO2, CH4 and H2O GHG analyzer) with the function import.LI7810
.
Usage
import.LI7810(
inputfile,date.format = "ymd",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(3.5, 0.6, 45)
)
Arguments
inputfile |
character string; the name of a file with the extension .data |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “ymd”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “CO2dry_ppm”, CH4dry_ppb” and H2O_ppm”. The default is prec = c(3.5, 0.6, 45) . |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For the instrument LI-7810, the date is found in the column “DATE”.
Note that this function was designed for the following units in the raw file:
- ppm for CO2 and H2O
- ppb for CH4
- kPa for pressure
- Celsius for temperature
If your LI-COR LI-7810 uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm for CO2 and H2O, or 1 ppb for CH4) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones found online for the latest model of this instrument available at the time of the creation of this function (11-2023).
Example
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "LI7810/LI7810.data", package = "goFlux")
file.path
# Import in the environment
<- import.LI7810(inputfile = file.path)
imp.LI7810
# Or save in a RData folder in the working directory
import.LI7810(inputfile = file.path, save = TRUE)
LI-7820
Import single raw gas measurement files from the LI-COR 7820 (N2O and H2O GHG analyzer) with the function import.LI7820
.
Usage
import.LI7820(
inputfile,date.format = "ymd",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(0.4, 45)
)
Arguments
inputfile |
character string; the name of a file with the extension .data |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “ymd”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “N2Odry_ppb” and H2O_ppm”. The default is prec = c(0.4, 45) . |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For the instrument LI-7820, the date is found in the column “DATE”.
Note that this function was designed for the following units in the raw file:
- ppb for N2O
- ppm for H2O
- kPa for pressure
- Celsius for temperature
If your LI-COR LI-7820 uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm for H2O, or 1 ppb for N2O) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones found online for the latest model of this instrument available at the time of the creation of this function (11-2023).
Example
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "LI7820/LI7820.data", package = "goFlux")
file.path
# Import in the environment
<- import.LI7820(inputfile = file.path)
imp.LI7820
# Or save in a RData folder in the working directory
import.LI7820(inputfile = file.path, save = TRUE)
LI-8100
Import single raw gas measurement files from the LI-COR 8100 (CO2 and H2O GHG analyzer) with the function import.LI8100
.
Usage
import.LI8100(
inputfile,date.format = "ymd",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(1, 10)
)
Arguments
inputfile |
character string; the name of a file with the extension .81x |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “ymd”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “CO2dry_ppm” and H2O_ppm”. The default is prec = c(1, 10) . |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For the instrument LI-8100, the date is found in the column “Date”.
Note that this function was designed for the following units in the raw file:
- ppm for CO2
- mmol/mol for H2O
- Celsius for temperature
If your LI-COR LI-8100 uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones provided by the manufacturer upon request, for the latest model of this instrument available at the time of the creation of this function (11-2023).
Example
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "LI8100/LI8100.81x", package = "goFlux")
file.path
# Import in the environment
<- import.LI8100(inputfile = file.path)
imp.LI8100
# Or save in a RData folder in the working directory
import.LI8100(inputfile = file.path, save = TRUE)
Smart Chamber (LI-8200)
Import single raw data files from the LI-COR smart chamber (LI-8200) with the function import.LI8200
.
Usage
import.LI8200(inputfile, date.format = "ymd", timezone = "UTC", save = FALSE)
Arguments
inputfile |
character string; the name of a file with the extension .json |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “ymd”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For the instrument LI-8200, the date is found under one of the measurements, next to ‘“Date”:’.
Note that this function was designed for the following units in the raw file:
- seconds for DeadBand
- cm for Area and Offset
- mmol/mol for H2O
- litters for volumes
- kPa for pressure
- Celsius for temperature
If your Smart Chamber uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
In addition, soil temperature and moisture are read with a HydraProbe connected to the Smart Chamber. If you are using a different setup, please contact the maintainer of this package for support.
As opposed to the other import functions, there is no option to “keep_all” with the Smart Chamber. If you would like to import additional data using this function, please contact the maintainer of this package for support.
Example
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "LI8200/LI8200.json", package = "goFlux")
file.path
# Import in the environment
<- import.LI8200(inputfile = file.path)
imp.LI8200
# Or save in a RData folder in the working directory
import.LI8200(inputfile = file.path, save = TRUE)
Aeris Technologies
MIRA Ultra CH4/ C2H6 analyzer
Import single raw data files from the MIRA Ultra CH4/ C2H6 Natural Gas Leak Detection System (with GPS) from Aeris Technologies with the function import.uCH4
.
Usage
import.uCH4(
inputfile,date.format = "mdy",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(1, 0.5, 15)
)
Arguments
inputfile |
character string; the name of a file with the extension .txt |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “mdy”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “CH4_ppb”, “C2H6dry_ppb” and “H2O_ppm”. The default is prec = c(1, 0.5, 15) . The precision for water vapor is currently unknown, and a default of 1 ppm is used. |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For these instruments, the date is found in the column “Time Stamp”.
Note that this function was designed for the following units in the raw file:
- ppm for CH4 and H2O
- ppb for C2H6
- mbars for pressure
- Celsius for temperature
If your Aeris instrument (MIRA Ultra CH4/ C2H6 analyzer) uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm for C2H6 and CH4, or 1 ppb for H2O) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones found online for the latest model of this instrument available at the time of the creation of this function (01-2024). The precision for water vapor is currently unknown, and a default of 1 ppm is used.
Examples
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "uCH4/uCH4.txt", package = "goFlux")
file.path
# Import in the environment
<- import.uCH4(inputfile = file.path)
imp.uCH4
# Or save in a RData folder in the working directory
import.uCH4(inputfile = file.path, save = TRUE)
MIRA Ultra N2O/ CO2 analyzer
Import single raw data files from the MIRA Ultra N2O/ CO2 High Accuracy Analyzer (with GPS) from Aeris Technologies with the function import.uN2O
.
Usage
import.uN2O(
inputfile,date.format = "mdy",
timezone = "UTC",
save = FALSE,
keep_all = FALSE,
prec = c(0.2, 0.2, 15)
)
Arguments
inputfile |
character string; the name of a file with the extension .txt |
date.format |
character string; specifies the date format found in the raw data file. Choose one of the following: “dmy”, “ymd”, or “mdy”. Default is “mdy”, as it is the date format from the example data file provided. |
timezone |
character string; a time zone in which to import the data to POSIXct format. Default is “UTC”. Note about time zone: it is recommended to use the time zone “UTC” to avoid any issue related to summer time and winter time changes. |
save |
logical; if save = TRUE , saves the file as an .RData file in a RData folder in the current working directory. If save = FALSE , returns the file in the Console, or load in the Environment if assigned to an object. |
keep_all |
logical; if keep_all = TRUE , keep all columns from the raw file. The default is keep_all = FALSE , and columns that are not necessary for gas flux calculation are removed. |
prec |
numerical vector; the precision of the instrument for each gas, in the following order: “CO2dry_ppm”, “N2O_ppb” and “H2O_ppm”. The default is prec = c(0.2, 0.2, 15) . |
Details
In date.format
, the date format refers to a date found in the raw data file, not the date format in the file name. For these instruments, the date is found in the column “Time Stamp”.
Note that this function was designed for the following units in the raw file:
- ppm for CO2, N2O and H2O
- mbars for pressure
- Celsius for temperature
If your Aeris instrument (MIRA Ultra N2O/ CO2 analyzer) uses different units, either convert the units after import, change the settings on your instrument, or contact the maintainer of this package for support.
The precision of the instrument is needed to restrict kappa-max (k.max
) in the non-linear flux calculation (HM.flux
). Kappa-max is inversely proportional to instrument precision. If the precision of your instrument is unknown, it is better to use a low value (e.g. 1 ppm for CO2 and N2O, or 1 ppb for H2O) to allow for more curvature, especially for water vapor fluxes, or very long measurements, that are normally curved. The default values given for instrument precision are the ones found online for the latest model of this instrument available at the time of the creation of this function (01-2024). The precision for water vapor is currently unknown, and a default of 1 ppm is used.
Examples
# Retrieve file path from example file in the goFlux package
# using the function system.file
<- system.file("extdata", "uN2O/uN2O.txt", package = "goFlux")
file.path
# Import in the environment
<- import.uN2O(inputfile = file.path)
imp.uN2O
# Or save in a RData folder in the working directory
import.uN2O(inputfile = file.path, save = TRUE)