Learn R Programming

wyz.code.metaTesting (version 1.1.22)

testFunction: Test function

Description

Apply data to function signature and record results.

Usage

testFunction(function_f_1,
             generatedData_l,
             functionName_s_1 = deparse(substitute(function_f_1)))

Value

A list with following names

generationargument name generation
datagenerated data
contextdata tyep generation context
nnumber of first level data generated

Generated data are ready for use and accessible using the data name of the list.

Arguments

function_f_1

a single R function, offensive programming ready, with using semantic argument names

generatedData_l

data to apply to the function. Could be generated by generateData function is desired.

functionName_s_1

A string that is the function name. Particularly useful, in scripts.

Details

Executes code and captures execution context and result, for posterior analysis.

See Also

Refer to opwf.

Examples

Run this code
# typical example
op_sum <- opwf(sum, c('...', 'removeNA_b_1'))
op_sum_atr <- list('...' = c('i', 'd', 'c'))
ec <- setGenerationContext(0, TRUE, FALSE)
gd <- generateData(op_sum, op_sum_atr, ec, erc$hetero_vector[[1]], dac$none)
tf <- testFunction(op_sum, gd$data)

Run the code above in your browser using DataLab