Moving columns within a data.frame() without retyping

The subset function has a nice select argument that gives a convenient way to select ranges of columns by name:

df <- subset(df, select=c(g,a:f))

Leave a Comment