Re: [R] Help with XYPLOT with marginal histograms
If you have many data points and/or have to depict several groups of them on the same graphics, and are -- to gain clarity -- willing to substitute - points with their summary (i.e, convex hull or density contour, plus a cross or ellipse depicting measures of centre and variability), and - marginal histograms with either relative frequency polygons or density estimates, just use the package chplot. It's available at CRAN and extremely easy to use (for R standards) - see the PDF manual. The added benefit is depicting correlation with the ellipse, and obtaining a bivariate measure of variability. After you produce the plot with the chplot function, you can add further elements with the chadd function. The package also contains one sample (large) datadaset. A paper (in CMPB, 2005) about is available at http://www1.mf.uni-lj.si/ibmi/biostat-center/predtiski/CMPB_Vidmar_Pohar_chplot.pdf. Note that chplot allows you to depict the points themselves, too (and even skip the convex hull/density contour), but that is basically the oposite of its main idea, which is to provide clarity with many points (from hundreds to hundreds of thousands) and/or several groups. Best regards, Assist.Prof. Gaj Vidmar, PhD Institute for Rehabilitation, Republic of Slovenia Univ. of Ljubljana, Fac. of Medicine, Inst. of Biomedical Informatics Deepayan Sarkar deepayan.sar...@gmail.com wrote in message news:eb555e660902111259o1c118567y4e0cc3812dce5...@mail.gmail.com... On Wed, Feb 11, 2009 at 12:37 PM, John Leonard john.leon...@coe.gatech.edu wrote: I am trying to replicate the following plot using Lattice: http://addictedtor.free.fr/graphiques/graphcode.php?graph=78 Why? lattice is not the right tool for this. Try looking at http://www.stat.wisc.edu/~deepayan/771/esplot.R with explanations in http://www.stat.wisc.edu/~deepayan/771/rgraphics.pdf -Deepayan __ 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] Help with XYPLOT with marginal histograms
I am trying to replicate the following plot using Lattice: http://addictedtor.free.fr/graphiques/graphcode.php?graph=78 I'm having trouble with the lattice equivalent of the oma (outside margin) setting. I've been all through the Lattice documentation and others and also searched the lists. Below is sample code that demonstrates where I'm at (it should paste and run within an R command prompt. I'm running 2.8.1): THANKS!!! snip library(lattice) library(grid) v1 = viewport( width=unit(0.8,npc), height=unit(0.8,npc), just=c(left,bottom), x=unit(0.0,npc), y=unit(0.0,npc), name=v1 ) v2 = viewport( width=unit(0.8,npc), height=unit(0.2,npc), just=c(left,bottom), x=unit(0.0,npc), y=unit(0.8,npc), name=v2 ) v3 = viewport( width=unit(0.8,npc), height=unit(0.2,npc), just=c(left,bottom), x=unit(0.8,npc), y=unit(0.8,npc), angle=-90, name=v3 ) pushViewport(v1) grid.rect() print( xyplot( NOx ~ E, data=ethanol, ), newpage=FALSE ) upViewport(); pushViewport(v2) grid.rect() print(histogram( ethanol$E ),newpage=FALSE) upViewport() pushViewport(v3) grid.rect() print( histogram( ethanol$NOx ) , newpage=FALSE ) [[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] Help with XYPLOT with marginal histograms
On Wed, Feb 11, 2009 at 12:37 PM, John Leonard john.leon...@coe.gatech.edu wrote: I am trying to replicate the following plot using Lattice: http://addictedtor.free.fr/graphiques/graphcode.php?graph=78 Why? lattice is not the right tool for this. Try looking at http://www.stat.wisc.edu/~deepayan/771/esplot.R with explanations in http://www.stat.wisc.edu/~deepayan/771/rgraphics.pdf -Deepayan __ 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.