# Example 1: Move variables 'hp' and 'am' to the first position
df.move(hp, am, data = mtcars)
# Example 2: Move variables 'hp' and 'am' to the last position
df.move(hp, am, data = mtcars, first = FALSE)
# Example 3: Move variables 'hp' and 'am' to the left-hand side of 'disp'
df.move(hp, am, data = mtcars, before = "disp")
# Example 4: Move variables 'hp' and 'am' to the right-hand side of 'disp'
df.move(hp, am, data = mtcars, after = "disp")
Run the code above in your browser using DataLab