How to add a new variable to an existing data frame, but I want to add to the front not end. eg. my dataframe is
b c d 1 2 3 1 2 3 1 2 3
I
df <- data.frame(b = c(1, 1, 1), c = c(2, 2, 2), d = c(3, 3, 3)) df ## b c d ## 1 1 2 3 ## 2 1 2 3 ## 3 1 2 3 df <- data.frame(a = c(0, 0, 0), df) df ## a b c d ## 1 0 1 2 3 ## 2 0 1 2 3 ## 3 0 1 2 3