title: Spark .mapValues setup with multiple values
body: <p>I am trying to setup mapValues so I can do something 
  I have the following RDD created:</p>
  
  <pre><code>res10: Array[(Int, (Double, Double, Double))] = Array((1,(9.1383276E7,1.868480924818E12,4488.0)), (22,(107667.11999999922,2582934.208799982,4488.0)), (2,(2.15141303E8,1.0585204549689E13,4488.0)), (3,(4488.0,4488.0,4488.0)), (44,(0.0,0.0,4488.0)), (18,(1348501.0,4.06652001E8,4488.0)), (9,(4488.0,4488.0,4488.0)))
  </code></pre>
  
  <p>I am trying to implement the following code but something is off in my syntax:</p>
  
  <pre><code>val dataStatsVals = dataStatsRDD.mapValues(x =&gt; {
    x._3, x._1, x._1/x._3, math.pow(((x._2/x._3 - x._1/x._3)), 2)
  })
  </code></pre>
  
  <p>I've been scouring the web trying to find a good .mapValues example that does something like this but can't seem to find it. </p>
  
  <p>Edit:
  Input is: Sum, Sum of Squares, and Count</p>
  
  <p>Output is: Count, Sum, Average, Variance </p>