func_code: func_code

View source: R/skitools.R

func_codeR Documentation

func_code

Description

Produces (simple) R code calling function named "func" with args in list "argv", prepending with source() call to directories in the vector "sources" if specified.

NOTE: args in ... can be lists or vectors consisting of numerical values or characters. Lists can have named fields. These will be assigned in a "hard coded" way in the Rcode, so these should be ideally scalars or pretty short vectors / lists.

For code to run properly, the names of "argv" must correspond to argument names of "func", or if the list has unnamed fields then they must be ordered in the order of the function args.

Useful for dumping tmp code files for farming when there are many arguments being passed

Usage

func_code(func, sources = c(), ...)

Arguments

func

function to call

sources

files to source

...

additional arguments to function which should contain numerical or character vectors or lists of such vectors

Value

character data of source file containing call to function with arguments hard coded

Author(s)

Marcin Imielinski


mskilab/skitools documentation built on Aug. 31, 2023, 1:13 p.m.