Move columns of a data frame or matrix to the left
Examples
x <- data.frame(a = 1:5, b = 2:6, c = 3:7)
moveColumnsToFront(x, "b")
#> b a c
#> 1 2 1 3
#> 2 3 2 4
#> 3 4 3 5
#> 4 5 4 6
#> 5 6 5 7
moveColumnsToFront(x, c("b", "a"))
#> b a c
#> 1 2 1 3
#> 2 3 2 4
#> 3 4 3 5
#> 4 5 4 6
#> 5 6 5 7