underscore in Map function in scala <p>A quick question about use of underscore in map function, suppose I have a RDD below:</p> <pre><code>val R_1 = sc.parallelize(List((1, 2), (3, 4), (5, 6))) R_1.map(x =&gt; x._1 + x._2) </code></pre> <p>result is (3, 7, 11)</p> <p>I got a error when I use <code>R_1.map(_._1 + _._2)</code> to do this.</p> <p>I dont really understand underscore magic in scala lambda expression. So my question is what is difference between <code>R_1.map(x =&gt; x._1 + x._2)</code> and <code>R_1.map(_._1 + _._2)</code>. Is there any other way to write <code>R_1.map(x =&gt; x._1 + x._2)</code>? any help is appreciated.</p>