dot-withHistory: .withHistory

.withHistoryR Documentation

.withHistory

Description

apply a function to an object and add this event to the object's processHistory, or return a list that contains the event history

Usage

.withHistory(
  fun = character(),
  args = list(),
  longArgs = list(),
  addHistory = TRUE,
  continueWithErrors = FALSE,
  returnIfError = NULL
)

Arguments

fun

character(1), name of the function to apply

args

named list of arguments to fun, will be kept in the ProcessHistory as they are

longArgs

arguments to fun that are large. They will be supplied to fun as they are, but will be summarized using summary() in the ProcessHistory.

addHistory

if TRUE, adds the processing history to the output object if an addProcessHistory method exists for it. If FALSE, this function returns a list(), see Value!

continueWithErrors

if TRUE, if an error occurs during the call to fun, it is recorded in the ProcessHistory, and the value specified in returnIfError is returned.

returnIfError

object to return if error occurs. Will be treated like the object returned by fun (ProcessHistory will be added to the object if possible to keep track of failed analyses).

Value

if addHistory = TRUE: the object returned by fun, with analyses performed as defined by args and longArgs and ProcessHistory added to the object. if addHistory = FALSE: a list with elements history and result


mjhelf/Metaboseek documentation built on April 23, 2022, 12:09 p.m.