Dear R Users Suppose I've certain values of A[1], A[2], A[3] ,A[4].....B[1],B[2],B[3]..C[1],C[2],C[3].....so on..All A,B,Cs are some numeric constant. I want to make an array which will look like [A[1], B[1], C[1], A[2], B[2], C[2], A[3], B[3] ,C[3]............ Please suggest me any way to do it.I would be deeply grateful. Ankit Kumar Gupta B.Tech. 3rd Yr IIT Roorkee India -- View this message in context: http://www.nabble.com/Array-Making-tp21200465p21200465.html Sent from the R help mailing list archive at Nabble.com.
Is this what you mean:> x <- 1:5 > y <- 11:15 > z <- 21:25 > c(rbind(x,y,z))[1] 1 11 21 2 12 22 3 13 23 4 14 24 5 15 25 Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of ykank > Sent: Monday, December 29, 2008 2:01 AM > To: r-help at r-project.org > Subject: [R] Array Making > > > Dear R Users > > Suppose I've certain values of A[1], A[2], A[3] > ,A[4].....B[1],B[2],B[3]..C[1],C[2],C[3].....so on..All A,B,Cs are some > numeric constant. > > I want to make an array which will look like [A[1], B[1], C[1], A[2], > B[2], > C[2], A[3], B[3] ,C[3]............ > > Please suggest me any way to do it.I would be deeply grateful. > > Ankit Kumar Gupta > B.Tech. 3rd Yr > IIT Roorkee > India > -- > View this message in context: http://www.nabble.com/Array-Making- > tp21200465p21200465.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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.
How about c(rbind(A,B,C)) a<-1:5> b<-11:15 > c<-21:25 > rbind(a,b,c)[,1] [,2] [,3] [,4] [,5] a 1 2 3 4 5 b 11 12 13 14 15 c 21 22 23 24 25> c(rbind(a,b,c))[1] 1 11 21 2 12 22 3 13 23 4 14 24 5 15 25 On Mon, Dec 29, 2008 at 4:01 AM, ykank <spicyankit4u at gmail.com> wrote:> > Dear R Users > > Suppose I've certain values of A[1], A[2], A[3] > ,A[4].....B[1],B[2],B[3]..C[1],C[2],C[3].....so on..All A,B,Cs are some > numeric constant. > > I want to make an array which will look like [A[1], B[1], C[1], A[2], B[2], > C[2], A[3], B[3] ,C[3]............ > > Please suggest me any way to do it.I would be deeply grateful. > > Ankit Kumar Gupta > B.Tech. 3rd Yr > IIT Roorkee > India > -- > View this message in context: http://www.nabble.com/Array-Making-tp21200465p21200465.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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. >