Re:R is a joy if you treat it like Awk
by lliamander on Monday October 07, 2019 @06:18PM
(#21186587)
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.
[ Parent
| on HN ]
Re:R is a joy if you treat it like Awk
by scottlocklin on Monday October 07, 2019 @07:27PM
(#21187085)
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.
Theres a pretty nice chapter on debugging in the great book Advanced R [1]. Hadley for the rescue! (As is commonplace in the context of R)
Re:R is a joy if you treat it like Awk
by eliashaddad on Thursday October 10, 2019 @10:28AM
(#21214891)
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.