I have the following data frame df:
df
v1 v2 v3 v4 1 1 5 7 4 2 2 6 10 3
And I want to obtain the following data frame
Just use mutate as is with a comma to separate new columns mutate(df,"v1v3"=v1*v3,"v2v4"= v2*v4)
mutate(df,"v1v3"=v1*v3,"v2v4"= v2*v4)