On Tue, Jan 7, 2014 at 8:30 PM, Pete Brecknock <Peter.Brecknock at bp.com>
wrote:> Krishia wrote
>> Hello,
>> I am pretty new to R and would like to transform my 272x12 matrix into
a
>> 3264X1. I'm trying to have the setup change from:
>>
>> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
>> 13,14,15,16,17,18,19,20,21,22, 23, 24
>> etc.
>>
>> to
>>
>> 1
>> 2
>> 3
>> 4
>> 5
>> 6
>> 7
>> 8
>> 9
>> 10
>> 11
>> 12
>> etc.
>>
>> Any suggestions?
>> Thanks in advance
>
> Krishia
>
> Is this what you are looking for?
>
> # Create example matrice
> m <- matrix(c(1,2,3,4,5,6,7,8,9,10,11,12), nrow=4, byrow=TRUE)
>
> # Create vector
> v <- c(t(m))
Or just
dim(m) <- NULL
Best,
Ista
>
> HTH
>
> Pete
>
>
>
> --
> View this message in context:
http://r.789695.n4.nabble.com/Dataset-to-single-column-matrix-tp4683231p4683238.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.