Re: [R] write a function to do pairwise calculation

2013-06-19 Thread arun
rror in cor(A, D) : incompatible dimensions A.K. From: Amanda Li To: arun Sent: Wednesday, June 19, 2013 1:11 AM Subject: Re: [R] write a function to do pairwise calculation Hello, Thanks for your help! I am a novice in R, and may I ask how I am suppose

Re: [R] write a function to do pairwise calculation

2013-06-17 Thread arun
;- combn(vec1,2) sapply(split(mat1,col(mat1)),function(.dat) dcor(get(.dat[1]),get(.dat[2]),1.5)) #    1 2 3 #0.1862890 0.2331567 0.2303689 A.K. - Original Message - From: Amanda Li To: r-help@r-project.org Cc: Sent: Monday, June 17, 2013 1:14 PM Subject: [R] wr

[R] write a function to do pairwise calculation

2013-06-17 Thread Amanda Li
Hello, I want to write a function to do pairwise calculation, but I don' know how to write it. Could anyone help? i.e. I have A (2*3), B(3*3), C(4*3) three matrices. I want to calculate distance correlation between each pair of matrices using code "dcor". How do I write a function so that I can g