title: Calculating Gini by Row in R
body: <p>stackoverflow.</p>
  
  <p>I'm trying to calculate the gini coefficient within each row of my dataframe, which is 1326 rows long, by 6 columns (1326 x 6).</p>
  
  <p>My current code...</p>
  
  <pre><code>attacks$attack_gini  &lt;- gini(x = c(attacks$attempts_open_play,
  attacks$attempts_corners,attacks$attempts_throws,
  attacks$attempts_fk,attacks$attempts_set_play,attacks$attempts_penalties))
  </code></pre>
  
  <p>... fills all the rows with the same figure of 0.7522439 - which is evidently wrong.</p>
  
  <p>Note: I'm using the gini function from the reldist package.</p>
  
  <p>Is there a way that I can calculate the gini for the 6 columns in each row?</p>
  
  <p>Thanks in advance.</p>