CodeDepends (version 0.6.5)

runUpToSection: Evaluate the code blocks up to a particular section of a document

Description

This function allows the caller to evaluate the code blocks within a document all the way up to a specified section of the document.

Usage

runUpToSection(section, doc, all = TRUE, env = globalenv(),
                nestedEnvironments = FALSE, frags = readScript(doc),
                 verbose = FALSE)

Arguments

section

the index of the section, i.e. a number

doc

the name of the file containing the code

all

a logical value. It should be TRUE for now.

env

the environment in which the expressions will be evaluated

nestedEnvironments

a logical value controlling whether the each code block should be evaluated in its own environment which are created with the previous code block's environment as a parent environment.

frags

the code fragments read from the document or specified directly by the caller.

verbose

logical value indicating whether to display the code

Value

A list containing the results of evaluating the different fragments. The list will have a length given by the section number.

See Also

sourceVariable

Examples

Run this code
# NOT RUN {
 frags = parse(system.file("samples", "dual.R", package = "CodeDepends"))  
 runUpToSection(3, frags = frags, verbose = TRUE, all = TRUE)
# }

Run the code above in your browser using DataCamp Workspace