confParser {StabPerf}R Documentation

Parses configuration files, returning code blocks found in a 'list' of 'expression's.

Description

Goes through a R formatted file and evaluates expressions found. Sets options globally and returns any blocks in {} as a list of expressions.

Usage

confParser(file=NULL, import=TRUE, run=FALSE, prefix="edaprakt")

Arguments

file character. Name of file to be sourced.
import logical. Should all expressions be evaluated in the global environment.
run logical. Whether found expression (which are not in {}) should be run

Details

The configuration file consists of four types of objects:

If import is true assignments are evaluated in the global environment and options, after being prepended with prefix, are defined globally. If run is true, any expressions found are evaluated in the global environment immediately. Expressions with {} are never evaluated immediately and are always returned in a list.

Value

blocks list. Blocks of code in {} that are ready to be sent to eval

See Also

source, options, eval

Examples

expressions <- confParser("file.conf", import=TRUE, run=TRUE, prefix="my")

[Package StabPerf version 0.5 Index]