Advanced Runtime Calculation in R

I once saw that someone ran an R script in which he managed to run a block of code, and then return the matrix of each function that was called in the code, and the total amount of time spent calculating this particular function. So, for example, I could do:

foo{ for(i in 1:10){ if(i < 5) {print i} } 

which return something like

for: 10 ms

if: 2 ms

print: 34 ms

I would appreciate it if anyone knows the name of the function that does this.

+4
source share
1 answer

Rprof and profr looked like answers; as stated in the comments. Let it be closed.

+2
source

Source: https://habr.com/ru/post/1486277/


All Articles