chop | R Documentation |
flux
or GPP/Reco modelling.
The function simply constructs a list of data.frame
s that each contains the data for one closed chamber measurement or for one NEE/GPP or R_eco model.
chop(dat, factors, nmes = NULL, min.cm = 3)
dat |
|
factors |
A character vector giving the names of the columns that are used to partition the data in |
nmes |
A character vector giving the names of the columns that are used to name the data chunks. |
min.cm |
Integer giving the minimum number of concentration measurements allowed per chamber measurement. Defaults to 3 because a linear fit to 2 points does not make any sense. Attention: Chamber placements with less than |
This could easily be hand scripted (e.g. with split
) but the function shall provide a simple way to obtain the structure needed for flux
and it also carries naming information.
Returns a list with 2 entries. The first is itself a list of data.frame
s containing the concentration measurements that result from the field sampling during one chamber placement (if factors
was 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.
Gerald Jurasinski <gerald.jurasinski@uni-rostock.de>
flux
## 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 gcd.parts <- chop(gcd, 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 # use inspect to have a look at (a) specific data table(s) inspect(gcd.parts, c("2011-03-15.c.3", "2011-03-15.c.6", "2011-03-15.p.6")) # inspect the same tables using their indices inspect(gcd.parts, c(3,6,12)) inspect(gcd.parts, c("c.3", "c.6", "p.6"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.