R has no functionality to specify where a new column is added. E.g., mtcars$mycol<-'foo'
. It always is added as last column. Using other means (e.g., dplyr's select()
) you can move the mycol to a desired position. This is not ideal and R may want to try to change that in the future.