I have a dataset similar to what is below:
ID | Var1 | Var2 | Var3 | Sum
-----------------------------
1 3 4 7
2 1 2 3
3 3 5 16
I need to create the Sum variable above. I need to be able to sum different values in a series of variables. For above, it'd be 14, 6, and 24, for rows 1, 2, and 3. I want to do it with something like
df$Sum <- sum('Var1', 'Var2', 'Var3')
I can't seem to find an example this simple. Everything I have found involved code that I either do not understand, or it's able to deal with situations far more complex than what I've got, and will have for the foreseeable future. I realize it would probably behoove me to learn something more in depth, but at this point I would like it to be simple. I have tried sum, aggregate, and rowSum, and none of them have gotten me what I want.
Any help is appreciated.