title: Error in library(functional) : there is no package called ‘functional’ - While running MR using rmr2
body: <p>I am trying to run a simple MR program using rmr2 in a single node Hadoop cluster. Here is the environment for the setup</p>
  
  <p>Ubuntu 12.04 (32 bit)<br>
  R (Ubuntu comes with 2.14.1, so updated to 3.0.2)<br>
  Installed the latest rmr2 and rhdfs from <a href="https://github.com/RevolutionAnalytics/RHadoop/wiki/Downloads" rel="nofollow">here</a> and the corresponding dependencies<br>
  Hadoop 1.2.1</p>
  
  <p>Now I am trying to run a simple MR program as</p>
  
  <pre><code>Sys.setenv(HADOOP_HOME="/home/training/Installations/hadoop-1.2.1")
  Sys.setenv(HADOOP_CMD="/home/training/Installations/hadoop-1.2.1/bin/hadoop")
  
  library(rmr2)  
  library(rhdfs)
  
  ints = to.dfs(1:100)  
  calc = mapreduce(input = ints, map = function(k, v) cbind(v, 2*v))
  from.dfs(calc)
  </code></pre>
  
  <p>The mapreduce job fails with the below error message in <strong>hadoop-1.2.1/logs/userlogs/job_201310091055_0001/attempt_201310091055_0001_m_000000_0/stderr</strong></p>
  
  <pre><code>Error in library(functional) : there is no package called ‘functional’  
  Execution halted  
  java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 1  
          at org.apache.hadoop.streaming.PipeMapRed.waitOutputThreads(PipeMapRed.java:362)  
          at org.apache.hadoop.streaming.PipeMapRed.mapRedFinished(PipeMapRed.java:576)  
  </code></pre>
  
  <p>But, the <code>sessionInfo()</code> shows that functional package has been loaded</p>
  
  <pre><code>&gt; sessionInfo()
  R version 3.0.2 (2013-09-25)
  Platform: i686-pc-linux-gnu (32-bit)
  
  &gt;locale:
   [1] LC_CTYPE=en_IN       LC_NUMERIC=C         LC_TIME=en_IN       
   [4] LC_COLLATE=en_IN     LC_MONETARY=en_IN    LC_MESSAGES=en_IN   
   [7] LC_PAPER=en_IN       LC_NAME=C            LC_ADDRESS=C        
  [10] LC_TELEPHONE=C       LC_MEASUREMENT=en_IN LC_IDENTIFICATION=C 
  
  &gt;attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  &gt;other attached packages:
   [1] rhdfs_1.0.6    rJava_0.9-4    rmr2_2.3.0     reshape2_1.2.2 plyr_1.8      
   [6] stringr_0.6.2  **functional_0.4** digest_0.6.3   bitops_1.0-6   RJSONIO_1.0-3 
  [11] Rcpp_0.10.5
  </code></pre>
  
  <p><strong>Update</strong> : I am able to run a R MR job reading and writing from STDIO without using the rmr2 and the rhdfs libraries as mentioned <a href="https://coderwall.com/p/imxf6g" rel="nofollow">here</a>. So, for now my guess is that the problem is isolated to rmr2 and the rhdfs packages.</p>
  
  <p>How to get around this problem?</p>