Hi,
I've been asked about profiling R code. I've never done that (unless you consider using microbenchmark on different versions of a function as poor man's profiling ). Hadley suggests to use lineprof in Advanced R http://adv-r.had.co.nz/Profiling.html: I know that RStudio supports profvis integration.
microbenchmark
lineprof
profvis
PS MOOCs recommendations would be fine.
I would say that "Advanced R" is as close to a book as you can get about this topic. Personally, I use profvis and it is quite OK to understand the problems. I didn't use lineprof yet, so nothing to say about it.