R/documentation_functions.R

Defines functions .writeDoc_Spectra3 .writeDoc_Spectra2 .writeDoc_Spectra1 .writeDoc_GraphicsReturn .writeDoc_Tol .writeDoc_LegLoc .writeDoc_GraphicsDots .writeDoc_Authors

#
# Functions to assist with roxygen2 documentation
#
# Not exported or documented
#
#' @author `r .writeDoc_Authors("BH")`
#'
#' @noRd
.writeDoc_Authors <- function(vec) {
  authors <- NA_character_
  if ("BH" %in% vec) authors <- c(authors, "Bryan A. Hanson (DePauw University)")
  if ("TG" %in% vec) authors <- c(authors, "Tejasvi Gupta")
  authors <- na.omit(authors)
  authors <- paste(authors, collapse = ", ")
  authors <- paste(authors, ".", sep = "")
  authors
}

#' @noRd
.writeDoc_GraphicsDots <- function() {
  "Parameters to be passed to the plotting routines. *Applies to base graphics only*."
}

#' @noRd
.writeDoc_LegLoc <- function() {
"Either a list with elements `x` and `y`, or a string like `'topright'`.  Values in a list should be on `[0,1]`, i.e. the lower left of the plot area is `0,0` and the upper right is `1,1`.  Allowed string values are those described in [graphics::legend()] under 'Details'. A value of `'none'` is acceptable as well."
}

#' @noRd
.writeDoc_Tol <- function() {
"A number describing the fraction of points to be labeled. `tol = 1.0` labels all the points; `tol = 0.05` labels *approximately* the most extreme 5 percent. Set to `'none'` to completely suppress labels. Note that a simple approach based upon quantiles is used, assumes that both x and y are each normally distributed, and treats x and y separately.  Thus, this is not a formal treatment of outliers, just a means of labeling points. Groups are lumped together for the computation."
}

#' @noRd
.writeDoc_GraphicsReturn <- function() {
"The returned value depends on the graphics option selected (see [GraphicsOptions()]).
* `base`: None.  Side effect is a plot.
* `ggplot2`: The plot is displayed, and a `ggplot2` object is returned if the value is assigned.  The plot can be modified in the usual `ggplot2` manner.
"
}

#' @noRd
.writeDoc_Spectra1 <- function() {
"An object of S3 class [ChemoSpec::Spectra()]."
}

#' @noRd
.writeDoc_Spectra2 <- function() {
"An object of S3 class [ChemoSpec2D::Spectra2D()]."
}

#' @noRd
.writeDoc_Spectra3 <- function() {
"An object of S3 class [ChemoSpec::Spectra()] or [ChemoSpec2D::Spectra2D()]."
}

Try the ChemoSpecUtils package in your browser

Any scripts or data that you put into this service are public.

ChemoSpecUtils documentation built on May 31, 2023, 5:56 p.m.