printHTML | R Documentation |
printHTML
creates a subdirectory named
"result" in the base directory specified via baseDir
. All HTML pages
and images will be put
in that directory.
printHTML(object, baseDir = ".")
object |
'trackInfo' S3 class object (list), containing the result of the
function |
baseDir |
A character string, specifying the base directory for the HTML pages to be written to. Defaults to the current working directory. |
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.
Thomas König, Klaus Jünemann & Matthias Burger
tracker
for the call tracking object definition.
## 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(resTrack, baseDir=tempdir())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.