Learn R Programming

flux (version 0.1-2)

conz.prep: Prepare data for flux rate estimation with flux

Description

The function simply constructs a list of data.frames that each contains the data for one static closed chamber measurement.

Usage

conz.prep(dat, columns, factors, nmes, min.cm = 3)

Arguments

dat
data.frame containing static closed chamber data for several chamber measurements. See columns and example for details.
columns
A character vector giving the names of the columns in dat that shall be considered.
factors
A character vector giving the names of the columns that are used to partition the data in dat into chunks that each contain the data for one chamber placement. factors $\subset$ columns! See example.
nmes
A character vector giving the names of the columns that are used to name the data chunks. nmes $\subset$ columns! See example.
min.cm
Integer giving the minimum number of concentration measurements allowed in the tables that are created per chamber measurement. Defaults to 3 because a linear fit to 2 points does not make any sense.

Value

  • Returns a list with 2 entries. The first is itself a list of data.frames containing the concentration measurements that result from the field sampling during one chamber placement (if factors has been specified correctly) and the columns specified in columns. The entries in the list are named according to nmes. However, the second part of the upper level list is a table with the naming information. This is handed over to flux and plot.fluss. See example.

encoding

UTF-8

Details

This could easily be hand scripted but the function shall provide a simple way to obtain the structure needed for flux.

See Also

flux

Examples

Run this code
## load example data
data(tt.pre)

## extract field concentration measurements
gcd <- tt.pre[tt.pre$sampletype_a=="P",]

## partition the data into data tables per chamber measurement
# first tell which columns of the data you want to carry on
columns <- c("date", "veg", "spot", "time_min", "temp_dC", "cham_area", 
"cham_vol", "CO2ppm", "CO2Code", "CH4ppb", "CH4Code", "N2Oppb", "N2OCode")
# then do the partitioning
gcd.parts <- conz.prep(gcd, columns, factors = c("date", "spot", "veg"), 
nmes = c("date", "veg", "spot"))
# have a look at the first three tables
gcd.parts$tables[1:3]
# have a look at the names part of the returned object
gcd.parts$nmes

Run the code above in your browser using DataLab