Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

Re: [R] Large matrix into a vector

John Kane

2007-03-28

Replies:

Is this something like what you want?

ab <- rep(1,4)
bb <- rep(2,4)
cc <- rep(3,4)
mydata <- data.frame(ab,bb,cc)
unlist(mydata)
unlist(data.frame(t(mydata)))


--- A Ezhil <ezhil02@(protected):

> Hi,
>
> I have a matrix HR(9x27). I would like to make a
> single vector with elements: t(HR[,1]) followed by
> t(HR[,2]) and then t(HR[,3] ... etc. Is there any
> neat
> way of converting this matrix into a vector rather
> doing something like c(t(HR[,1]), t(HR[,2]),
> t(HR[,3])
> ..)?
>
> Thanks in Advance.
> Kind regards,
> Ezhil
>
>
>
>
____________________________________________________________________________________
> TV dinner still cooling?
> Check out "Tonight's Picks" on Yahoo! TV.
>
> ______________________________________________
> R-help@(protected)
> 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@(protected)
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.
©2008 r-help.com - Jax Systems, LLC, U.S.A.