Memory Profiling with lineprof
This is taken directly from http://adv-r.had.co.nz/Profiling.html.
library(lineprof)
## Error in `library()`:
## ! there is no package called 'lineprof'
f <- function() {
pause(0.1)
g()
h()
}
g <- function() {
pause(0.1)
h()
}
h <- function() {
pause(0.1)
}
tmp <- tempfile()
Rprof(tmp, interval = 0.1)
f()
## Error in `pause()`:
## ! could not find function "pause"
Rprof(NULL)
file.show(tmp)
(l <- lineprof(f()))
## Error in `lineprof()`:
## ! could not find function "lineprof"
shine(l)