RE: [R] How to convert array to c()

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Thu 19 May 2005 - 00:57:57 EST


Is this what you want?

> split(a, row(a))

$"1"
[1] 1 5 9

$"2"
[1] 2 6 10

$"3"
[1] 3 7 11

$"4"
[1] 4 8 12

Andy

> From: Muhammad Subianto
>
> Dear R-helper,
>
> Is there possible to make this array:
> > a <- array(1:12, c(4, 3))
> > a
> [,1] [,2] [,3]
> [1,] 1 5 9
> [2,] 2 6 10
> [3,] 3 7 11
> [4,] 4 8 12
> >
>
> like:
> c(1,5,9)
> c(2,6,10)
> c(3,7,11)
> c(4,8,12)
>
> Thank you very much in advance.
> Regards,
> Muhammad Subianto
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 19 01:20:07 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:50 EST