Re: [R] outer to vectors

2009-02-09 Thread Jorge Ivan Velez
Dear Patricia, Take a look at this post: http://www.nabble.com/Re:-applying-cor.test-to-a-(m,-n)-matrix---SUMMARY-to17150239.html#a17150239 The easiest way is using cor. See ?cor for details. Here is an example: set.seed(12) A<-matrix(rnorm(30),ncol=3) cor(A) # [,1] [,2] [,3] # [1,

Re: [R] outer to vectors

2009-02-09 Thread jim holtman
'combn' will give you the combinations that you can then use as parameters in the function: > combn(c('a', 'b', 'c'), 2) [,1] [,2] [,3] [1,] "a" "a" "b" [2,] "b" "c" "c" > On Mon, Feb 9, 2009 at 11:44 AM, patricia garcía gonzález wrote: > > Hi all, > > Having a matrix A formed by n ve

[R] outer to vectors

2009-02-09 Thread patricia garcía gonzález
Hi all, Having a matrix A formed by n vectors as columns. Is there anything to calculate a determined function to all combination of vectors? For example imagine A matrix is compose by vectors a, b and c. And the function to perform is correlation, so I would like to obtain cor(a, b), cor(a,