Skip to content

looping through 3D array

1 message · arun

#
Hi Alex,

Not sure if this is what you wanted.
length(res) #from the previous 'example' using ##indx <- combn(dim(results)[1],2)
#[1] 45

mat1 <- matrix(0,10,10)
?mat1[lower.tri(mat1)] <- res
?mat1[upper.tri(mat1)] <- res

A.K.
On Saturday, January 11, 2014 12:22 AM, alex padron <alexpadron1082 at gmail.com> wrote:
Thanks for these.?

I am using?

library(multicore)
res <- unlist(mclapply(seq_len(ncol(indx)), function(i) {?x1 <- indx[,i];emd2d(results2[x1[1],,],results2[x1[2],,])}, mc.cores=48))

How can I write the output of res as a matrix that has rows and columns for each of the calculated distances? So if there is a total of say 100 distances calculated the output matrix should have 10 rows and 10 columns.?


-Alex
On Thu, Jan 9, 2014 at 2:05 PM, arun <smartpink111 at yahoo.com> wrote:
Also,