ta in R by row
Dear arun,
That code works. Thanks so much for the hints!
Best wishes,
HJ
Sent using BlackBerry® from Orange
-Original Message-
From: arun
Date: Mon, 9 Jul 2012 22:12:03
To: HJ YAN
Reply-To: arun
Cc: R help
Subject: Re: [R] Read vector as multi-dimensional data in R
Hi,
Try this:
b1<-aperm(array(a,dim=c(5,2,2)),perm=c(2,1,3))
> b1
, , 1
[,1] [,2] [,3] [,4] [,5]
[1,] 1 2 3 4 5
[2,] 6 7 8 9 10
, , 2
[,1] [,2] [,3] [,4] [,5]
[1,] 11 12 13 14 15
[2,] 16 17 18 19 20
A.K.
- Original Message -
2 matches
Mail list logo