stackoverflow.
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).
My current code...
attacks$attack_gini <- gini(x = c(attacks$attempts_open_play,
attacks$attempts_corners,attacks$attempts_throws,
attacks$attempts_fk,attacks$attempts_set_play,attacks$attempts_penalties))
... fills all the rows with the same figure of 0.7522439 - which is evidently wrong.
Note: I'm using the gini function from the reldist package.
Is there a way that I can calculate the gini for the 6 columns in each row?
Thanks in advance.