do_processing {simdata}R Documentation

Post-processing of datamatrix

Description

Applies functions to a matrix or data.frame.

Usage

do_processing(x, functions = list())

Arguments

x

Matrix or Data.frame.

functions

List of lists, specifying functions to be applied as well as their arguments. See details.

Details

Functions are passed into the post-processor as a named list. The name f of the list entry is the function to be applied via base::do.call. The list entry itself is another named list, specifying the arguments to the function f as named arguments.

The functions must take a matrix or data.frame as first argument and return another matrix or data.frame of the same dimensions as single output.

Examples of post-processing steps are truncation (process_truncate_by_iqr, process_truncate_by_threshold) or centering / standardizing data (via scale, see example section below).

Can be useful to apply on simulated datasets, even outside of the simulation function (e.g. when standardization is only required at the modeling step).

Value

Matrix or data.frame with post-processing applied.

Note

Use with caution - no error checking is done for now so the user has to take care of everything themselves! Furthermore, output of the functions is not checked either.

Examples

do_processing(diag(5), 
    functions = list(scale = list(center = TRUE, scale = FALSE)))


[Package simdata version 0.4.0 Index]