HI,
Try this:
source("arrayconvert.txt")
#dat2 is the data frame
dat4<-split(dat2,dat2$p)
res1<-do.call(rbind,lapply(lapply(lapply(dat4,`[`,5),function(x)
matrix(x,dim=list(20,1))),unlist))
dim(res1)
#[1] 50 20
head(res1,3)
# [,1] [,2] [,3] [,4] [,5] [,6]
On Sep 28, 2012, at 3:59 PM, farnoosh sheikhi wrote:
> Hi,
>
> I have a 3d array as below, I want to make this array to a matrix of
> p=50(rows) and n=20(columns) with the coverage values .
> The code before the array is:
?matrix
mat <- matrix(datfrm$coverage, 50, 20)
filled.contour(mat) # u
2 matches
Mail list logo