using aggregate function automatcly all the option make a sum.

aggregate(df, :x2, sum)
>

*this is a example  from the table*
x1  x2
1   10
1   10
1   7
1   8
2   3
2   3
3  6
3  10

*this is a correct output*
1 4
2 2
3 2

Thanks

Reply via email to