debug.line: Displaying variable values

Description Usage Arguments Details Value See Also Examples

View source: R/debugLine.R

Description

debug.line displays the values of variables that are either used or set on a particular line.

debug.state displays the values of all variables in the global environment after execution of a particular line.

debug.variable shows all values that a particular variable has during execution of a script.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
debug.line(..., script.num = 1, all = FALSE)

debug.state(..., script.num = 1, showType = FALSE)

debug.variable(
  ...,
  val.type = "all",
  script.num = "all",
  all = FALSE,
  showType = FALSE
)

Arguments

...

The variable names to be queried.

script.num

The script number of the queried variables. Defaults to "all".

all

If TRUE, results for all variables of the specified script will be returned.

showType

If TRUE, variable container, dimension, and type are displayed.

val.type

If not "all", this filters the results to contain only instances where the valType (container or type) has the queried type. Only one type may be queried per function call.

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.

For each line number queried, debug.line returns a data frame of the data that the procedure in that line inputs and outputs. Each data frame contains the following columns:

For each queried line, debug.state returns a data frame showing the state at that line, after it has been executed. Each data frame contains the following columns:

If no paramters are given, debug.state will return the state at the end of execution.

For each variable queried, debug.variable returns a data frame of all instances (data nodes) of that variable. Each data frame contains the following columns:

Value

debug.line returns a list of data frames showing the inputs and outputs for the procedure in each line queried.

debug.state returns a list of data frames of states for each queried line number, or the state at the end of execution if no parameters are given to the function.

debug.variable returns a list of data frames showing all instances of each variable queried.

See Also

provDebugR Initialisation Functions:

prov.debug

prov.debug.file

prov.debug.run

Other provDebugR Functions (non-initialisation):

debug.error: Returns the backwards lineage of the error, if any. The error may be queried on StackOverflow.

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.type.changes: Returns a data frame for each variable in the execution containing the instances where the data type changed.

debug.warning: Returns the backwards lineage of the queried warning(s), if any.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
prov.debug.run("test.R")
debug.line(5)
debug.line(all = TRUE)
debug.line(5, 10, script.num = 2)
debug.line(3, script.num = "all")

## End(Not run)

## Not run: 
prov.debug.run("test.R")
debug.state()
debug.state(5)
debug.state(10, 20, script.num = 2)
debug.state(5, script.num = "all")

## End(Not run)

## Not run: 
prov.debug.run("test.R")
debug.variable(x)
debug.variable(all = TRUE)
debug.variable("a", b, "x", val.type = "logical")
debug.variable("a", "b", x, script.num = 3)

## End(Not run)

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