Testing and debugging the rmr2 program

Since running a MapReduce program will require a considerable amount of time, varying from a few minutes to several hours, testing and debugging become very important. In this recipe, we will illustrate some techniques you can use to troubleshoot an R MapReduce program.

Getting ready

In this recipe, you should have completed the previous recipe by installing rmr2 into an R environment.

How to do it...

Perform the following steps to test and debug an R MapReduce program:

  1. First, you can configure the backend as local in rmr.options:
    > rmr.options(backend = 'local')
    
  2. Again, you can execute the number squared MapReduce program mentioned in the previous recipe:
    > b.time = proc.time() 
    > small.ints= to.dfs(1:100000) ...

Get R: Recipes for Analysis, Visualization and Machine Learning 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.