[R] pairs plot
my data are matrix with 3 numeric columns. would like to have pairs plot with scatterplots in the upper with hist at the diag and with correlation at the lower. actually default pairs does almost what I want but looks semi awesome. Especially, i didn't find out how to remove the axes from the lower part where I do only want to display the numeric values correlations there and somehow axes don't fit. Hence I am looking at ggpairs from GGally and calling it without parameters looks almost perfect : but I cant find out how they got the Corr: in the upper, so I can't put it in the lower, and I do not know how to put the hist in the diag. please help -- Witold Eryk Wolski __ 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.
Re: [R] pairs plot
On 10/11/2013 02:01 AM, Witold E Wolski wrote: my data are matrix with 3 numeric columns. would like to have pairs plot with scatterplots in the upper with hist at the diag and with correlation at the lower. actually default pairs does almost what I want but looks semi awesome. Especially, i didn't find out how to remove the axes from the lower part where I do only want to display the numeric values correlations there and somehow axes don't fit. Hence I am looking at ggpairs from GGally and calling it without parameters looks almost perfect : but I cant find out how they got the Corr: in the upper, so I can't put it in the lower, and I do not know how to put the hist in the diag. Hi Witold, The example below is roughly what you want, I think. This could be wrapped up in a function similar to pairs and I might do this in future if I get the time. wwdat-data.frame(a=seq(1,5,length.out=20)+rnorm(20), b=seq(1,4,length.out=20)+rnorm(20),c=rnorm(20)) require(plotrix) panes(matrix(1:9,nrow=3,byrow=TRUE),c(1.2,1,1.2),c(1.2,1,1.2)) # plot 1 par(mar=c(0,3,3,0)) hist(wwdat$a,xaxt=n,xlab=,ylab=,main=) box() # plot 2 par(mar=c(0,0,3,0)) plot(wwdat$a,wwdat$b,xaxt=n,yaxt=n,xlab=,ylab=) axis(3) # plot 3 par(mar=c(0,0,3,3)) plot(wwdat$a,wwdat$c,xaxt=n,yaxt=n,xlab=,ylab=) axis(3) axis(4) # plot 4 par(mar=c(0,3,0,0)) plot(0,0,xlim=c(-1,1),ylim=c(-1,1),xaxt=n,yaxt=n,xlab=,ylab=,type=n) text(0,0,round(cor(wwdat$a,wwdat$b),2),cex=2.5) # plot 5 par(mar=c(0,0,0,0)) hist(wwdat$b,xaxt=n,yaxt=n,xlab=,ylab=,main=) # plot 6 par(mar=c(0,0,0,3)) plot(wwdat$b,wwdat$c,xaxt=n,yaxt=n,xlab=,ylab=) axis(4) # plot 7 par(mar=c(3,3,0,0)) plot(0,0,xlim=c(-1,1),ylim=c(-1,1),xaxt=n,yaxt=n,xlab=,ylab=,type=n) text(0,0,round(cor(wwdat$c,wwdat$a),2),cex=2.5) # plot 8 par(mar=c(3,0,0,0)) plot(0,0,xlim=c(-1,1),ylim=c(-1,1),xaxt=n,yaxt=n,xlab=,ylab=,type=n) text(0,0,round(cor(wwdat$c,wwdat$b),2),cex=2.5) # plot 9 par(mar=c(3,0,0,3)) hist(wwdat$c,xaxt=n,yaxt=n,xlab=,ylab=,main=) axis(4) box() Jim __ 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.
Re: [R] pairs plot
Hi Greg I saw, read, the TeachingDemos you suggesttef but when run pairs2 function on my R module says Can´t find function pairs2 How can I load the module or function pairs2? Thanks in advance for your help. You are the best. 2009/7/27, Greg Snow greg.s...@imail.org: Look at the pairs2 function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Jose Narillos de Santos Sent: Monday, July 27, 2009 9:02 AM To: r-help@r-project.org Subject: [R] pairs plot Hi all, I want to plot trough pairs() plot a matrix with 4 columns. I want to make a trhee plot in a graph. Plotting pairs colum 2,3,4 on y axis and 1 on X axis. You mean (a plot with three graphs) ommitting the first pair with itself. And only the pairs with colum 1 with the other not all pairs. I. e. this matrix 4177 289390 8740 17220 3907 301510 8530 17550 3975 316970 8640 17650 3651 364220 9360 21420 3031 387390 9960 23410 2912 430180 11040 25820 3018 499930 12240 27620 2685 595010 13800 31670 2884 661870 14760 37170 Thanks in advance. [[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.
Re: [R] pairs plot
Hi r-help-boun...@r-project.org napsal dne 28.07.2009 09:55:11: Hi Greg I saw, read, the TeachingDemos you suggesttef but when run pairs2 function on my R module says Can´t find function pairs2 How can I load the module or function pairs2? Did you do library(TeachingDemos)? Regards Petr Thanks in advance for your help. You are the best. 2009/7/27, Greg Snow greg.s...@imail.org: Look at the pairs2 function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Jose Narillos de Santos Sent: Monday, July 27, 2009 9:02 AM To: r-help@r-project.org Subject: [R] pairs plot Hi all, I want to plot trough pairs() plot a matrix with 4 columns. I want to make a trhee plot in a graph. Plotting pairs colum 2,3,4 on y axis and 1 on X axis. You mean (a plot with three graphs) ommitting the first pair with itself. And only the pairs with colum 1 with the other not all pairs. I. e. this matrix 4177 289390 8740 17220 3907 301510 8530 17550 3975 316970 8640 17650 3651 364220 9360 21420 3031 387390 9960 23410 2912 430180 11040 25820 3018 499930 12240 27620 2685 595010 13800 31670 2884 661870 14760 37170 Thanks in advance. [[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. __ 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.
Re: [R] pairs plot
Hi, I tried to load typing library(TeachingDemos) But the message can´t find package TeachingDemos) occurs. I use versión R 2.9 on windows. Can you please guide me? Sorry¡¡¡ 2009/7/28, Petr PIKAL petr.pi...@precheza.cz: Hi r-help-boun...@r-project.org napsal dne 28.07.2009 09:55:11: Hi Greg I saw, read, the TeachingDemos you suggesttef but when run pairs2 function on my R module says Can´t find function pairs2 How can I load the module or function pairs2? Did you do library(TeachingDemos)? Regards Petr Thanks in advance for your help. You are the best. 2009/7/27, Greg Snow greg.s...@imail.org: Look at the pairs2 function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Jose Narillos de Santos Sent: Monday, July 27, 2009 9:02 AM To: r-help@r-project.org Subject: [R] pairs plot Hi all, I want to plot trough pairs() plot a matrix with 4 columns. I want to make a trhee plot in a graph. Plotting pairs colum 2,3,4 on y axis and 1 on X axis. You mean (a plot with three graphs) ommitting the first pair with itself. And only the pairs with colum 1 with the other not all pairs. I. e. this matrix 4177 289390 8740 17220 3907 301510 8530 17550 3975 316970 8640 17650 3651 364220 9360 21420 3031 387390 9960 23410 2912 430180 11040 25820 3018 499930 12240 27620 2685 595010 13800 31670 2884 661870 14760 37170 Thanks in advance. [[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. [[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.
Re: [R] pairs plot
Have you installed it first? First: install.packages(TeachingDemos) Then: library(TeachingDemos) --- On Tue, 7/28/09, Jose Narillos de Santos narillosdesan...@gmail.com wrote: From: Jose Narillos de Santos narillosdesan...@gmail.com Subject: Re: [R] pairs plot To: Petr PIKAL petr.pi...@precheza.cz, r-help@r-project.org, greg.s...@imail.org Received: Tuesday, July 28, 2009, 8:24 AM Hi, I tried to load typing library(TeachingDemos) But the message can´t find package TeachingDemos) occurs. I use versión R 2.9 on windows. Can you please guide me? Sorry¡¡¡ 2009/7/28, Petr PIKAL petr.pi...@precheza.cz: Hi r-help-boun...@r-project.org napsal dne 28.07.2009 09:55:11: Hi Greg I saw, read, the TeachingDemos you suggesttef but when run pairs2 function on my R module says Can´t find function pairs2 How can I load the module or function pairs2? Did you do library(TeachingDemos)? Regards Petr Thanks in advance for your help. You are the best. 2009/7/27, Greg Snow greg.s...@imail.org: Look at the pairs2 function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Jose Narillos de Santos Sent: Monday, July 27, 2009 9:02 AM To: r-help@r-project.org Subject: [R] pairs plot Hi all, I want to plot trough pairs() plot a matrix with 4 columns. I want to make a trhee plot in a graph. Plotting pairs colum 2,3,4 on y axis and 1 on X axis. You mean (a plot with three graphs) ommitting the first pair with itself. And only the pairs with colum 1 with the other not all pairs. I. e. this matrix 4177 289390 8740 17220 3907 301510 8530 17550 3975 316970 8640 17650 3651 364220 9360 21420 3031 387390 9960 23410 2912 430180 11040 25820 3018 499930 12240 27620 2685 595010 13800 31670 2884 661870 14760 37170 Thanks in advance. [[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. [[alternative HTML version deleted]] -Inline Attachment Follows- __ 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. __ Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now http://ca.toolbar.yahoo.com. __ 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.
Re: [R] pairs plot
r-help-boun...@r-project.org napsal dne 28.07.2009 15:39:03: Have you installed it first? First: install.packages(TeachingDemos) Or if you have problems with correct setting through corporate network rules (like myself) you can download a zip (for Windows) version and unzip it to library subdirectory. Then: library(TeachingDemos) shall be executed without problem Regards Petr --- On Tue, 7/28/09, Jose Narillos de Santos narillosdesan...@gmail.com wrote: From: Jose Narillos de Santos narillosdesan...@gmail.com Subject: Re: [R] pairs plot To: Petr PIKAL petr.pi...@precheza.cz, r-help@r-project.org, greg.s...@imail.org Received: Tuesday, July 28, 2009, 8:24 AM Hi, I tried to load typing library(TeachingDemos) But the message can´t find package TeachingDemos) occurs. I use versión R 2.9 on windows. Can you please guide me? Sorry¡¡¡ 2009/7/28, Petr PIKAL petr.pi...@precheza.cz: Hi r-help-boun...@r-project.org napsal dne 28.07.2009 09:55:11: Hi Greg I saw, read, the TeachingDemos you suggesttef but when run pairs2 function on my R module says Can´t find function pairs2 How can I load the module or function pairs2? Did you do library(TeachingDemos)? Regards Petr Thanks in advance for your help. You are the best. 2009/7/27, Greg Snow greg.s...@imail.org: Look at the pairs2 function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Jose Narillos de Santos Sent: Monday, July 27, 2009 9:02 AM To: r-help@r-project.org Subject: [R] pairs plot Hi all, I want to plot trough pairs() plot a matrix with 4 columns. I want to make a trhee plot in a graph. Plotting pairs colum 2,3,4 on y axis and 1 on X axis. You mean (a plot with three graphs) ommitting the first pair with itself. And only the pairs with colum 1 with the other not all pairs. I. e. this matrix 4177 289390 8740 17220 3907 301510 8530 17550 3975 316970 8640 17650 3651 364220 9360 21420 3031 387390 9960 23410 2912 430180 11040 25820 3018 499930 12240 27620 2685 595010 13800 31670 2884 661870 14760 37170 Thanks in advance. [[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. [[alternative HTML version deleted]] -Inline Attachment Follows- __ 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. __ Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now http://ca.toolbar.yahoo.com. __ 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. __ 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.
[R] pairs plot
Hi all, I want to plot trough pairs() plot a matrix with 4 columns. I want to make a trhee plot in a graph. Plotting pairs colum 2,3,4 on y axis and 1 on X axis. You mean (a plot with three graphs) ommitting the first pair with itself. And only the pairs with colum 1 with the other not all pairs. I. e. this matrix 4177 289390 8740 17220 3907 301510 8530 17550 3975 316970 8640 17650 3651 364220 9360 21420 3031 387390 9960 23410 2912 430180 11040 25820 3018 499930 12240 27620 2685 595010 13800 31670 2884 661870 14760 37170 Thanks in advance. [[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.
Re: [R] pairs plot
Look at the pairs2 function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Jose Narillos de Santos Sent: Monday, July 27, 2009 9:02 AM To: r-help@r-project.org Subject: [R] pairs plot Hi all, I want to plot trough pairs() plot a matrix with 4 columns. I want to make a trhee plot in a graph. Plotting pairs colum 2,3,4 on y axis and 1 on X axis. You mean (a plot with three graphs) ommitting the first pair with itself. And only the pairs with colum 1 with the other not all pairs. I. e. this matrix 4177 289390 8740 17220 3907 301510 8530 17550 3975 316970 8640 17650 3651 364220 9360 21420 3031 387390 9960 23410 2912 430180 11040 25820 3018 499930 12240 27620 2685 595010 13800 31670 2884 661870 14760 37170 Thanks in advance. [[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. __ 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.