Programming by visualizing the big picture

Now, we will work with a top-down approach, meaning that we'll start with abstract code first and gradually move into the implementation details. Generally I find this approach to be more efficient when you have a clear idea of what you want to do. In our case, we'll start by working with the main.R file.

The first thing to note is that we will use the proc.time() function twice, once at the beginning and once at the end, and we will use the difference among these two values to measure how much time it took for the whole code to execute. The second thing to note is that the empty_directories() function makes sure each of the specified directories exist, and deletes any files contained in them. We ...

Get R Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.