V1 V2 5 6 4 4 2 5
How would I swap the values in these two column vectors. So that the outcome would be:
V1 V2 6 5 4 4 5 2
the easiest way to do this:
tmp <- df[1] df[1] <- df[2] df[2] <- tmp