add: Add or replace a function in a queue

View source: R/add.R

addR Documentation

Add or replace a function in a queue

Description

Functions starting with add_... do add a function to a queue which is processed by the coresponding run_... command.

The functions do reqquire exactly two arguments with the first named input and the second one named output. They should return either TRUE when run successful, or FALSE when failed. Although, the checking is not yet implemented.

Usage

add(fun, funname, queue)

add_additor(fun)

add_archiver(fun)

add_extractor(fun)

add_pre_processor(fun)

Arguments

fun

function which is run when calling run_...() The functions must not require any arguments!

funname

name of the function

queue

name of queue in getOption("LEEF")

Details

add: The function which is doing the adding - normally the specific add_* functions are used

add_additor: Adding a named function to the queue of additors. If the named function already exists will it be replaced.

add_archiver: Adding a named function to the queue of archivers. If the named function already exists will it be replaced.

These functions do archive the results of the current processing step.

add_extractor: Adding a named function to the queue of extractors. If the named function already exists will it be replaced.

These functions should extract data from the pre-processed data. The extracted data should be usable for the actual analysis to address the actual research question.

add_pre_processor: Adding a named function to the queue of pre-processors. If the named function already exists will it be replaced.

This function should pre-process the raw data. The pre-processed data should be archive ready, i.e. contain the same information as the raw data, be in an open format, and be compressed if possible.

Value

invisibly the function queue.

invisibly the function queue. A list which is processed

invisibly the function queue. A list which is processed

Examples

## Not run: 
## To add the function `cat` to the `additor` queue
add (fun = cat, .queue = "additor")

## To add the function `paste` to the `extractor` queue
add (cat, "cat", "extractor")

## End(Not run)
add_additor( fun = cat )
add_additor( fun = cat )
add_extractor( fun = paste )
add_pre_processor( fun = paste )

LEEF-UZH/LEEF documentation built on Feb. 10, 2025, 5:20 a.m.