# 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