[R] What is the fastest way to combine all columns of a matrix to one column?

Bert Gunter gunter.berton at gene.com
Mon Feb 27 23:25:26 CET 2012


Mod Rolf's question, the answer probably is: do nothing  -- it already
**is** a single column.

If you read the section on arrays and matrices in "An Intro to R"
*carefully* (this is part of every standard R distro) you will be
enlightened. Have you read it? If not, why not?

If mat is your matrix,

c(mat)

may also be enlightening.

-- Bert

On Mon, Feb 27, 2012 at 1:42 PM, Rolf Turner <rolf.turner at xtra.co.nz> wrote:
> On 27/02/12 20:57, ali_protocol wrote:
>>
>> Dear all,
>>
>> Newbie: What is the fastest way to combine all columns of a matrix to one
>> column?
>
>
> What (on earth!) do you mean  by ``combine''?  *You* understand
> what you mean; I doubt that anyone else does.  For Pete's sake, if
> you are going to ask a question, make it clear what the <expletive
> deleted> you are asking!
>
> A self-contained reproducible example always helps.
>
>    cheers,
>
>        Rolf Turner
>
> ______________________________________________
> 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.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm



More information about the R-help mailing list