mgcv2tapas | R Documentation |
mgcv2tapas() makes it easy to import a trend that was generated with the
mgcv::gam()
function into the tapas environment, such that the
data can be further analysed for peaks with the tapas::global_thresh()
or the tapas::local_thresh()
functions.
mgcv2tapas(series = NULL, data_type = "accI", series.name = NA, plotit = TRUE)
series |
A list generated with the |
data_type |
The dimension of the input variable. By default,
|
series.name |
A string defining the name of the input matrix, typically the site name. Defaults to NA. |
plotit |
Logical. If |
mgcv2tapas() extracts data from the list that was generated with the
mgcv::gam()
function. In addition, it fetches data from the
data frame that was called by the mgcv::gam()
function. Thus,
that data frame has to be available in the R environment.
The function additionally plots the data along with the GAM-modeled trend (red line) and the 2 standard errors of the GAM model (blue lines), and plots the detrended data with the GAM-modeled trend.
mgcv2tapas() returns a list that can be further processed to detect peaks
with the tapas::global_thresh()
or the tapas::local_thresh()
functions.
mgcv2tapas() returns a tapas::SeriesDetrend()
-styled list.
The GAM-modeled trend is stored in the $detr sublist.
To populate the $int sublist, which is typically generated by the
tapas::pretreatment_data()
function, mgcv2tapas() pulls the
necessary data from the data frame that was called by the
mgcv::gam()
function. Thus, either from a data frame that was
generated with the tapas::tapas2mgcv()
function (if the data was
binned), or from a non-binned data frame (that has the same format as the
input data frame for the tapas::pretreatment_data()
function).
The $int sublist includes three sublists:
the $series.int sublist contains the data that was used by the
mgcv::gam()
function and that can be further processed with the
tapas::global_thresh()
or the tapas::local_thresh()
functions.
In the case of sedimentary charcoal records, this data has typically the
dimension of charcoal-accumulation rates.
the $series.conI and the $series.countI sublists should contain the
concentration and count values, respectively. To generate these data sets,
mgcv2tapas() requires a user-determined parameter (data_type
) that
declares the dimension of the input data. If data_type
== "accI" or
"acc", the data for the $series.conI and the $series.countI sublists
is calculated by mgcv2tapas(). If data_type
== "conI", or
"con", the $series.int and the $series.conI will contain the same data.
If data_type
== "countI" or "count", the $series.int and the
$series.countI will contain the same data.
Walter Finsinger
tapas2mgcv()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.