Browse Source

Complete first draft of complete `preprocess_spc` documentation

pull/3/head
Philipp Baumann 7 years ago
parent
commit
786e7919e6
  1. 23
      R/preprocess-spc.R
  2. 28
      man/preprocess_spc.Rd

23
R/preprocess-spc.R

@ -1,6 +1,27 @@
#' @title Preprocess spectra from spectral data object (tibble)
#' @title Preprocess spectra
#' @description Preprocesses spectra in tibble column by sample_id after
#' averaging spectra by \code{simplerspec::average_spc()}.
#' @param spc_tbl Tibble that contains spectra to be preprocessed within
#' a list-column.
#' @param select Character vector of predefined preprocessing options to be
#' applied to the spectra list-column specified in \code{column_in}.
#' Common prefined values are stated as abbreviated preprocessing methods and
#' options such as \code{"sg_1_w21"}, where \code{"sg"} stands for
#' Savitzky-Golay and \code{1} for first derivative and \code{"w21"}
#' for a window size of 21 points.
#' @param column_in Character vector of single list-column in \code{spc_tbl} that
#' contain list of spectra (1 row matrix) to be processed by function supplied
#' in \code{select}.
#' @param custom_function A character string of a custom processing function
#' that is later parsed (produces expression in a list) and evaluated within
#' the function \code{preprocess_spc}.
#' The character vector argument of \code{custom_function}
#' needs to contain \code{"spc_raw"}, which is the single data table of spectra
#' that results from binding a list of data.tables (spectra to preprocess)
#' from the spectra list-column specified in \code{column_in}.
#' An example for a value is
#' \code{"prospectr::savitzkyGolay(X = spc_raw, m = 0, p = 3, w = 9)"}.
#' Optional argument. Default is \code{NULL}.
#' @export
preprocess_spc <- function(spc_tbl, select, column_in = "spc_mean",
custom_function = NULL) {

28
man/preprocess_spc.Rd

@ -2,11 +2,37 @@
% Please edit documentation in R/preprocess-spc.R
\name{preprocess_spc}
\alias{preprocess_spc}
\title{Preprocess spectra from spectral data object (tibble)}
\title{Preprocess spectra}
\usage{
preprocess_spc(spc_tbl, select, column_in = "spc_mean",
custom_function = NULL)
}
\arguments{
\item{spc_tbl}{Tibble that contains spectra to be preprocessed within
a list-column.}
\item{select}{Character vector of predefined preprocessing options to be
applied to the spectra list-column specified in \code{column_in}.
Common prefined values are stated as abbreviated preprocessing methods and
options such as \code{"sg_1_w21"}, where \code{"sg"} stands for
Savitzky-Golay and \code{1} for first derivative and \code{"w21"}
for a window size of 21 points.}
\item{column_in}{Character vector of single list-column in \code{spc_tbl} that
contain list of spectra (1 row matrix) to be processed by function supplied
in \code{select}.}
\item{custom_function}{A character string of a custom processing function
that is later parsed (produces expression in a list) and evaluated within
the function \code{preprocess_spc}.
The character vector argument of \code{custom_function}
needs to contain \code{"spc_raw"}, which is the single data table of spectra
that results from binding a list of data.tables (spectra to preprocess)
from the spectra list-column specified in \code{column_in}.
An example for a value is
\code{"prospectr::savitzkyGolay(X = spc_raw, m = 0, p = 3, w = 9)"}.
Optional argument. Default is \code{NULL}.}
}
\description{
Preprocesses spectra in tibble column by sample_id after
averaging spectra by \code{simplerspec::average_spc()}.

Loading…
Cancel
Save