Looking under the hood with debug()


July 14, 2020

If you’ve ever tried to look “under the hood” of an R function, you know that sometimes it can be tricky to figure out what’s going on, especially if you use R more as a statistical tool than as a programming language. Sometimes you really need to take a look at what a function is doing behind the scenes though. Using the debug() function with R and R Studio is a great way to do this, but it can be really intimidating. I made a short demo to show you how to get started with using debug() to peer into the inner workings of R functions.