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,]  1.0000000 -0.2015320  0.7235916
# [2,] -0.2015320  1.0000000 -0.5559593
# [3,]  0.7235916 -0.5559593  1.0000000

HTH,

Jorge


On Mon, Feb 9, 2009 at 11:44 AM, patricia garcía gonzález <
kurtney...@hotmail.com> wrote:

>
> 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, c) and cor(b, c).
>
> I we had numbers instead of vector, the function is outer, but I am not
> able to apply it to vectors...
>
> Thanks a lot.
>
> P.
>
>
>
> > Date: Mon, 9 Feb 2009 08:37:06 -0800
> > From: zzn...@gmail.com
> > To: r-help@r-project.org
> > Subject: Re: [R] installing R on Ubuntu
> >
> > On Mon, Feb 9, 2009 at 4:51 AM, Neil Shephard <nsheph...@gmail.com>
> wrote:
> > >
> > > The preceived "difficulty" of installing R under whatever flavour of
> > > GNU/Linux in this thread stems from being unfamiliar with the process
> of the
> > > package management of the flavour of GNU/Linux you use (and in part by
> the
> > > various distros not having the most recent version of R in their
> > > repositories.
> > >
> > > People who say "why can't it be as easy as dowloading a self-installing
> > > binary and running that" are trying to fit a round peg (their
> experience and
> > > understanding of how applications install in M$-windows) in a square
> hole
> > > (or triangular, hexagonal, or whatever depending on the distribution of
> > > GNU/Linux).
> >
> > This is true. However, for the most common Linux distros --Debian, Red
> > Hat Enterprise / CentOS / Scientific Linux / Fedora, openSUSE and
> > Ubuntu -- you can install the most recent R compiled for your distro
> > from
> >
> > http://<your-nearest-CRAN-mirror>/bin/linux/
> >
> > In addition, most of the distros have third-party repositories where
> > you can find the latest version of R. In short, if you have an x86 or
> > x86_64/amd64 system running almost any Linux, you can find a
> > pre-compiled R. R is a popular package, and it's pretty easy to find
> > even for Power PC or some of the obscure architectures.
> >
> > >
> > > There are pro's and con's to each of the GNU/Linux flavours and its
> really a
> > > matter of deciding which you like/have invested time in learning.
> > >
> > > Irrespective its still simple to install R from source under
> GNU/Linux...
> > >
> > > 1) Download source tar-ball
> > > 2) Extract and cd to the directory
> > > 3) ./configure --prefix=/where/you/want/R/to/go (optionally setting the
> > > install path at this stage)
> > > 4) ./make
> > > 5) ./make install
> > >
> > > ...all documented in the FAQ at
> > >
> http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-R-be-installed-_0028Unix_0029
> >
> > Many Linux distros do *not* install the development tools by default,
> > and which ones live in which packages varies by distro. Fedora in
> > particular is extremely stripped when you install from the LiveCD. You
> > have to install gcc, make and a couple of other things just to install
> > VMware Tools, for example, when running Fedora as a VMware guest. For
> > building R from source and installing R packages, you'll also need to
> > install gfortran. And many libraries with external dependencies, like
> > Rgraphviz, will require not only the package itself (graphviz) but
> > also the C headers, which may have the name "graphviz-devel" on some
> > distros and some other name on other distros.
> > >
> > > This might not be as clean as using the native package management, but
> does
> > > mean that you'll have the latest version installed.
> > >
> > > Neil
> > >
> > > (Addendum - I've tried several different distros, starting with RedHat
> 7.3,
> > > then various versions of Slackware 8 through to 9 before settling on
> Gentoo,
> > > all were easy to install R in).
> >
> > I just recently switched from Gentoo to openSUSE. Gentoo usually had
> > the latest R source in their repository within a day or so of it
> > coming out of the R Project release cycle. To get it, all you needed
> > to do was put the package name in the "/etc/portage/package-keywords"
> > file. And Gentoo, since it is almost all compiled from source, by
> > nature *does* have all the development tools installed and installs
> > all the headers when it installs packages.
> >
> > --
> > M. Edward (Ed) Borasky
> >
> > I've never met a happy clam. In fact, most of them were pretty steamed.
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> _________________________________________________________________
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to