It the little bits of R programming I've done, the biggest pain for me was debugging. If something fails, I had no idea what line of code the error happened. Since some of the functions were rather long, step-wise debugging was laborious.
Yeah, I had this problem until I discovered options(error=recover) which drops you into a nice lispy stack. And ya, someone told me about it: I don't know where you'd read about such things. There's probably a dozen alternatives I also don't know where to read about.
Besides the aforementioned browser(), try() and tryCatch(), you would check the packages assertive and assertr to guarantee the expected inputs, and testthat to create tests for your scripts. All awesome.