Here are 2 possibilities: cbind( iris[,1, drop=FALSE], 1, iris[,2:5] ) cbind( iris, 1) [ ,c(1,6,2:5) ]
-- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Mohan L > Sent: Tuesday, November 09, 2010 7:26 AM > To: r-help@r-project.org > Subject: [R] help to add a new column filled with value 1 > > Dear All, > > I have a data frame with 5 column and 201 row data. I want to add one > more column between column 1 and 2 with value of 1. So the new column > has to be the second column filled with 1. Any help will be > appreciated. > > Thanks for your time. > > > Thanks & Rg > Mohan L > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.