Skip to content

Commit

Permalink
updated NAMESPACE
Browse files Browse the repository at this point in the history
  • Loading branch information
wfinsinger committed May 11, 2022
1 parent c107d61 commit 79e22db
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 29 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export(SeriesDetrend)
export(check_pretreat)
export(global_thresh)
export(local_thresh)
export(mgcv2tapas)
export(peak_detection)
export(pretreatment_data)
export(tapas2mgcv)
Expand Down
34 changes: 19 additions & 15 deletions R/mgcv2tapas.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Import a trend determined by GAM into tapas
#'
#' @description
#' 'mgcv2tapas()' makes it easy to import a trend that was generated with the
#' \code{mgcv::gam()} function into the 'tapas' environment, such that the
#' mgcv2tapas() makes it easy to import a trend that was generated with the
#' \code{mgcv::gam()} function into the tapas environment, such that the
#' data can be further analysed for peaks with the \code{tapas::global_thresh()}
#' or the \code{tapas::local_thresh()} functions.
#'
Expand All @@ -22,7 +22,7 @@
#' current device.
#'
#' @details
#' 'mgcv2tapas()' extracts data from the list that was generated with the
#' mgcv2tapas() extracts data from the list that was generated with the
#' \code{mgcv::gam()} function. In addition, it fetches data from the
#' data frame that was called by the \code{mgcv::gam()} function. Thus,
#' that data frame has to be available in the R environment.
Expand All @@ -33,50 +33,54 @@
#'
#'
#' @returns
#' 'mgcv2tapas() returns a list that can be further processed to detect peaks
#' mgcv2tapas() returns a list that can be further processed to detect peaks
#' with the \code{tapas::global_thresh()} or the \code{tapas::local_thresh()}
#' functions.
#'
#' 'mgcv2tapas()' returns a \code{tapas::SeriesDetrend()}-styled list.
#' mgcv2tapas() returns a \code{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
#' \code{tapas::pretreatment_data()} function, 'mgcv2tapas()' pulls the
#' \code{tapas::pretreatment_data()} function, mgcv2tapas() pulls the
#' necessary data from the data frame that was called by the
#' \code{mgcv::gam()} function. Thus, either from a data frame that was
#' generated with the \code{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 \code{tapas::pretreatment_data()} function).
#'
#' The $int sublist includes three sublists:
#' - the '$series.int' sublist contains the data that was used by the
#' - the $series.int sublist contains the data that was used by the
#' \code{mgcv::gam()} function and that can be further processed with the
#' \code{tapas::global_thresh()} or the \code{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
#' - 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 (\code{data_type}) that
#' mgcv2tapas() requires a user-determined parameter (\code{data_type}) that
#' declares the dimension of the input data. If \code{data_type} == "accI" or
#' "acc", the data for the '$series.conI' and the '$series.countI' sublists
#' is calculated by 'mgcv2tapas()'. If \code{data_type} == "conI", or
#' "con", the '$series.int' and the '$series.conI' will contain the same data.
#' If \code{data_type} == "countI" or "count", the '$series.int' and the
#' '$series.countI' will contain the same data.
#' "acc", the data for the $series.conI and the $series.countI sublists
#' is calculated by mgcv2tapas(). If \code{data_type} == "conI", or
#' "con", the $series.int and the $series.conI will contain the same data.
#' If \code{data_type} == "countI" or "count", the $series.int and the
#' $series.countI will contain the same data.
#'
#' @seealso [tapas2mgcv()]
#'
#' @importFrom dplyr all_of pull
#' @importFrom dplyr all_of
#' @importFrom dplyr pull
#' @importFrom mgcv predict.gam
#' @importFrom stringr str_replace
#'
#' @author Walter Finsinger
#'
#' @export


mgcv2tapas <- function(series = NULL,
data_type = "accI",
series.name = NA,
plotit = TRUE) {


## Extract data ####

## Extract data from the list that was generated by the mgcv::gam() function
Expand Down
28 changes: 14 additions & 14 deletions man/mgcv2tapas.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 79e22db

Please sign in to comment.