I have a data frame with a lot of rows. I now would like to add the rows 2 and 5 so that row 5 remains with the new values:
x y z
1 1 1 0
2 1 1 0
3 1 1 2
4 2 0 1
5 2 1 1
6 2 0 1
OUTPUT:
x y z
1 1 1 0
2 1 1 0
3 1 1 2
4 2 0 1
5 3 2 1
6 2 0 1
Unfrotunately, when I try to exert df[1,]<-df[1,]+df[2,] in my dataframe, the error term: Error in FUN(left, right) : non-numeric argument to binary operator emerges. I would appreciate some help.