R/section.R

Defines functions sections

Documented in sections

#' List section options.
#'
#' @param select section to be returned
#'
#' @return list of section options
#' @export
#'
#' @seealso \code{\link{FETCH}}
#'
#' @examples
#' # show sections
#' sections()
#'
#' # select section
#' sections("header_min")
#'
sections <- function(select = NULL){
  sections_ <- list(
    all = "",
    header = "HEADER",
    header_min = "HEADER.FIELDS%20(DATE%20FROM%20TO%20SUBJECT)",
    body = "TEXT"
  )
  if(!is.null(select)){
    return(sections_[[select]])
  }
  sections_
}
crazycapivara/imapr documentation built on May 14, 2019, 11:32 a.m.