Folks, Sorry for butting in here. I ran the code from John Kane below and it worked fine. I did however get a deprecation message suggesting the use of ggpairs from the GGally package to make this chart. Unfortunately I haven't found the correct incantation to get the diagonal to display the density plots using the "diag" parameter. Any suggestions? Just trying to learn, Thanks, KW -- On Jun 11, 2013, at 6:00 AM, r-help-request at r-project.org wrote:> Message: 7 > Date: Mon, 10 Jun 2013 06:05:48 -0800 > From: John Kane <jrkrideau at inbox.com> > To: Gundala Viswanath <gundalav at gmail.com>, "r-help at stat.math.ethz.ch" > <r-help at stat.math.ethz.ch> > Subject: Re: [R] All against all correlation matrix with GGPLOT Facet > Message-ID: <3B7B03D1854.000003F5jrkrideau at inbox.com> > Content-Type: text/plain; charset="US-ASCII" > > No image. The R-help list tends to strip out a lot of files. A pdf or txt usually gets through. In any case I understand what you want this may do it. > > library(ggplot2) > dat1 <- data.frame( v = rnorm(13), > w = rnorm(13), > x = rnorm(13), > y = rnorm(13), > z = rnorm(13)) > plotmatrix(dat1) > > John Kane > Kingston ON Canada > > >> -----Original Message----- >> From: gundalav at gmail.com >> Sent: Mon, 10 Jun 2013 12:26:44 +0900 >> To: r-help at stat.math.ethz.ch >> Subject: [R] All against all correlation matrix with GGPLOT Facet >> >> I have the following data: >> >> v <- rnorm(13) >> w <- rnorm(13) >> x <- rnorm(13) >> y <- rnorm(13) >> z <- rnorm(13) >> >> >> Using GGPLOT facet, what I want to do is to create a 5*5 matrix, >> where each cells plot the correlation between >> each pair of the above data. E.g. v-v,v-w; v-x,...,z-z >> >> >> What's the way to do it? >> Attached is the image. >> >> GV. >> ______________
Note that the code below might not work in RStudio. I am gettting an intermittant crash when I use the ggpairs() command in RStudio and sometimes I get a density plot and sometimes not. Also the command is taking 3-5 minutes to execute. This may just be a peculiarity of my machine but the code works fine and fairly fast in a terminal. John Kane Kingston ON Canada> -----Original Message----- > From: jrkrideau at inbox.com > Sent: Tue, 11 Jun 2013 06:48:31 -0800 > To: kw1958 at gmail.com, r-help at r-project.org > Subject: [R] ggpairs in GGally replaces plotmatrix in ggplot2 > > Hi Keith,, > ggpairs(dat1, upper = list(continuous = "density", combo = "box")) > appears to be what you want. > > > > John Kane > Kingston ON Canada > > >> -----Original Message----- >> From: kw1958 at gmail.com >> Sent: Tue, 11 Jun 2013 09:25:48 -0400 >> To: r-help at r-project.org >> Subject: Re: [R] R-help Digest, Vol 124, Issue 12 >> >> Folks, >> >> Sorry for butting in here. I ran the code from John Kane below and it >> worked fine. >> >> I did however get a deprecation message suggesting the use of ggpairs >> from the GGally package to make this chart. >> >> Unfortunately I haven't found the correct incantation to get the >> diagonal >> to display the density plots using the "diag" parameter. >> >> Any suggestions? >> >> Just trying to learn, >> Thanks, >> KW >> >> -- >> >> On Jun 11, 2013, at 6:00 AM, r-help-request at r-project.org wrote: >> >>> Message: 7 >>> Date: Mon, 10 Jun 2013 06:05:48 -0800 >>> From: John Kane <jrkrideau at inbox.com> >>> To: Gundala Viswanath <gundalav at gmail.com>, "r-help at stat.math.ethz.ch" >>> <r-help at stat.math.ethz.ch> >>> Subject: Re: [R] All against all correlation matrix with GGPLOT Facet >>> Message-ID: <3B7B03D1854.000003F5jrkrideau at inbox.com> >>> Content-Type: text/plain; charset="US-ASCII" >>> >>> No image. The R-help list tends to strip out a lot of files. A pdf or >>> txt usually gets through. In any case I understand what you want this >>> may do it. >>> >>> library(ggplot2) >>> dat1 <- data.frame( v = rnorm(13), >>> w = rnorm(13), >>> x = rnorm(13), >>> y = rnorm(13), >>> z = rnorm(13)) >>> plotmatrix(dat1) >>> >>> John Kane >>> Kingston ON Canada >>> >>> >>>> -----Original Message----- >>>> From: gundalav at gmail.com >>>> Sent: Mon, 10 Jun 2013 12:26:44 +0900 >>>> To: r-help at stat.math.ethz.ch >>>> Subject: [R] All against all correlation matrix with GGPLOT Facet >>>> >>>> I have the following data: >>>> >>>> v <- rnorm(13) >>>> w <- rnorm(13) >>>> x <- rnorm(13) >>>> y <- rnorm(13) >>>> z <- rnorm(13) >>>> >>>> >>>> Using GGPLOT facet, what I want to do is to create a 5*5 matrix, >>>> where each cells plot the correlation between >>>> each pair of the above data. E.g. v-v,v-w; v-x,...,z-z >>>> >>>> >>>> What's the way to do it? >>>> Attached is the image. >>>> >>>> GV. >>>> ______________ >> >> ______________________________________________ >> R-help at 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. > > ____________________________________________________________ > FREE ONLINE PHOTOSHARING - Share your photos online with your friends and > family! > Visit http://www.inbox.com/photosharing to find out more! > > ______________________________________________ > R-help at 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.____________________________________________________________ FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!
Thanks, I obviously read the help incorrectly. It does give the same results as plotmatrix(dat1) I take back "some" of the nasty thoughts I was thinking about ggpairs(). Any idea of the problem with RSudio? Keith notices the same speed difference (but no crash) on a Mac while I'm runnng Ubuntu 12.10. John Kane Kingston ON Canada> -----Original Message----- > From: istazahn at gmail.com > Sent: Tue, 11 Jun 2013 17:54:55 -0400 > To: kw1958 at gmail.com > Subject: Re: [R] ggpairs in GGally replaces plotmatrix in ggplot2 > > I think the ggpairs equivalent is > > ggpairs(dat1, upper=list(continuous="points"), axisLabels="show") > > oddly enough. > > ggpairs(dat1) > > should default to the same graph as > > plotmatrix(dat1) > > but there seems to be a conflict between the default > axisLabels="internal" and density plots. Or something. There is a bug > report at https://github.com/ggobi/ggally/issues/18 that may be > related. > > Best, > Ista > > On Tue, Jun 11, 2013 at 4:07 PM, Keith S Weintraub <kw1958 at gmail.com> > wrote: >> Yes. I was able to run it in RStudio but it did seem much slower than in >> R.app (on the Mac). >> >> Note that the "it" that I ran still didn't give the same results as >> plotmatrix. >> >> Thanks, >> KW >> >> -- >> >> On Jun 11, 2013, at 11:16 AM, John Kane <jrkrideau at inbox.com> wrote: >> >>> Note that the code below might not work in RStudio. I am gettting an >>> intermittant crash when I use the ggpairs() command in RStudio and >>> sometimes I get a density plot and sometimes not. Also the command is >>> taking 3-5 minutes to execute. >>> >>> This may just be a peculiarity of my machine but the code works fine >>> and fairly fast in a terminal. >>> >>> John Kane >>> Kingston ON Canada >> >> ______________________________________________ >> R-help at 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.____________________________________________________________ FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family! Visit http://www.inbox.com/photosharing to find out more!