printHTML.trackinfo: Write HTML pages of the tracking result.

Description Usage Arguments Details Author(s) See Also Examples

Description

printHTML.trackInfo creates a subdirectory named "result" in the base directory specified via baseDir. All HTML pages and images will be put in that directory.

Usage

1
  printHTML.trackInfo(object, baseDir = ".")

Arguments

object

'trackInfo' S3 class object (list), containing the result of the function tracker.

baseDir

A character string, specifying the base directory for the HTML pages to be written to. Defaults to the current working directory.

Details

An "index.html" page will be created in the directory "results" which is the root entry page of the HTML pages. The displayed result for every tracked function consists of two HTML pages. The first page is an overview on how often every line of code was executed. Code lines not executed are highlighted red, executed lines are shown in green. The second page is a graph representation of the execution flow of the function. Each code line has a edge pointing to the next code line that is executed subsequently. Thus loops and jumps become clearly visible.

Author(s)

Thomas König, Klaus Jünemann & Matthias Burger

See Also

tracker for the call tracking object definition.

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
##  example function
foo <- function(x){
   y <- 0
   for(i in 1:100)
   {
      y <- y + i
   }
   return(y)
}

##  the name track is necessary
track <- tracker()

##  initialize the tracker
track$init()

##  inspect the function
##  res is the result of foo
res <- inspect(foo(10), track = track)

##  get the tracking info
resTrack <- track$getTrackInfo()

##  create HTML pages
printHTML.trackInfo(resTrack)

RUnit documentation built on May 1, 2019, 6:30 p.m.