[R] Stacking of vectors to form a column vector

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Thu Apr 30 05:20:25 CEST 2015

I am sure you can use c() because columns may be vectors even though vectors are not columns, but you really need to follow the posting guide and provide a reproducible example for us to show you how. You might find [1] helpful, in particular as it describes the use of the dput function to give us a few rows of your data.

[1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example 
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
Sent from my phone. Please excuse my brevity.

On April 29, 2015 7:48:24 PM PDT, Olufemi Bolarinwa <dafemlions at yahoo.co.uk> wrote:
>Thank you Jeff for your response.
>My y1, y2, y3 are actually 3 columns in the data so I cannot use the
>c() function to concatenate them. I am confusing the "columns" with
>vectors. I actually meant columns.
>Any help will be much appreciated
>On Wednesday, 29 April 2015, 22:31, Jeff Newmiller
><jdnewmil at dcn.davis.CA.us> wrote:
>Vectors are not "columns" or "rows". Use the c() function to
>concatenate vectors.
>Jeff Newmiller                        The    .....      .....  Go
>DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.      ##.#.  Live
>                                      Live:  OO#.. Dead: OO#..  Playing
>Research Engineer (Solar/Batteries            O.O#.      #.O#.  with
>/Software/Embedded Controllers)              .OO#.      .OO#. 
>Sent from my phone. Please excuse my brevity.
>On April 29, 2015 6:56:46 PM PDT, Olufemi Bolarinwa
><dafemlions at yahoo.co.uk> wrote:
>>Hello,I am estimating a system of nonlinear equation where I need to
>>stack my vector of y. I have data of about 6000units. I tried using
>>rbind but instead of having a vector of 1 by 18000, it is giving me a
>>by 6000 so that my matrix multiplication is non-conformable. The stack
>>command requires an identifier but in this case, I do not have a
>>I would like to stack the the first 6000 units of y1 on the 2nd 6000
>>units of y2 and 6000 units of y3.
>>Any help will be greatly appreciated.
>>    [[alternative HTML version deleted]]
>>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>PLEASE do read the posting guide
>>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list