I have a data frame "data" which has around 20 columns. Looks somewhat like :
Name Data1 Data2 Data3 Data4 Data5 ....
Fred 2 0 1 3 7
Tim 2 3 6 5 6
Jack 3 1 1 2 6
Denise 4 5 0 2 8
I want to insert three columns "ID", "Age", "School" after the first column.
Is there anyway to do that?
I tried this :
ID<-''
Age<-''
School<-''
data<-cbind(data[,1], ID, Age, School, data[,2:ncol(data)])
It adds these columns but the first column becomes "data[,1]" and there is no way I can rename it.