debug.exceptions: Tracking the Lineage of Errors and Warnings

Description Usage Arguments Details Value See Also Examples

Description

debug.error displays the backwards lineage of (the statements leading up to) an error that occurred when R code was executed.

debug.warning displays the backwards lineage of (the statements leading up to) one or more warnings that occurred when R code was executed.

Usage

1
2
3
debug.error(stack.overflow = FALSE)

debug.warning(..., all = FALSE)

Arguments

stack.overflow

If TRUE, the error message will be searched for on Stack Overflow.

...

The warning(s) to be queried.

all

If TRUE, the lineages of all warnings are returned.

Details

These functions are part of the provDebugR package. To use them, you must first initialise the debugger using one its initialisation functions: prov.debug, prov.debug.file, or prov.debug.run.

The lineage is represented with a data frame that shows the R statements whose execution led to the error or warning. More specifically, each row of the data frame corresponds to one line of code. The columns of the data frame are:

Value

debug.error returns a data frame representing the backwards lineage of the error in the execution, if any.

debug.warning returns a list of data frames of lineages for the queried warnings.

See Also

provDebugR Initialisation Functions:

prov.debug

prov.debug.file

prov.debug.run

Other provDebugR Functions (non-initialisation):

debug.line: Returns all immediate inputs and outputs for the line(s) queried.

debug.lineage: Returns the forwards or backwards lineage of the data object(s) queried. The forwards lineage shows how the data object was used, and the backwards lineage shows how it was produced.

debug.state: Returns the state at the line(s) queried, after the line had been executed. The state is the list of all variables and their values in the environment at the queried line.

debug.type.changes: Returns a data frame for each variable in the execution containing the instances where the data type changed.

debug.variable: Returns a data frame showing all instances of the variable(s) queried.

debug.view: Opens and displays the contents of each file or variable or variable queried.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
prov.debug.run("test.R")

debug.error()
debug.error(stack.overflow = TRUE)

debug.warning(1)
debug.warning(2,3)
debug.warning(all = TRUE)

## End(Not run)

provDebugR documentation built on April 22, 2021, 5:11 p.m.