
Annotates source files with profile information.
annotateSource(pd, value = c("pct", "time", "hits"), GC = TRUE,
sep = ": ", show = TRUE, ...)
profile data as returned by readProfileData
.
character; show result as percentage, time, or hits.
logical; include GC information or not.
character; separator between profile info and source lines.
logical; if true, show files with file.show
.
additional arguments for file.show
.
A list of character vectors of the annotated file lines.
For lines that appear in the stack trace the percent time and, optionally, GC time are shown before each line.
Rprof
,
summaryRprof
,
flatProfile
,
filterProfileData
,
readProfileData
,
srcSummary
# NOT RUN {
## This defines the function rw()
source(system.file("samples", "rw.R", package="proftools"))
## Execute the function and collect profile data
Rprof(tmp <- tempfile(), gc.profiling = TRUE, line.profiling = TRUE)
w <- rw(200000)
Rprof(NULL)
pd <- readProfileData(tmp)
unlink(tmp)
## Annotate the sources
annotateSource(pd)
# }
Run the code above in your browser using DataLab