I am new to R and I have to do something as: I have to get a final result of the following: final_x=df1+df2+df3 where df1, df2, and df3 are three data frames with 1 column each (but different lengths) as follows:
df1
x1
1. 1
2. 4
3. 4
4. 6
df2
x2
1. 1
2. 4
3. 4
4. 6
5. 6
6. 6
7. 8
df3
x3
1. 1
2. 4
3. 4
4. 6
5. 6
As a final result, I would like my final_x to be the following:
final_x
final
1. 3
2. 12
3. 12
4. 18
5. 12
6. 6
7. 8
So to get the sum of each element from the columns, despite their different lengths. Basically, when I try to sum them up, I get the error saying '+' only defined for equally-sized data frames.