[R] Large matrices and pairs/ggpairs

Greg Snow 538280 at gmail.com
Thu May 22 04:41:18 CEST 2014


You can specify whatever plotting size you want for graphics devices,
so for example you could send the plot to a pdf device set up as A0 or
other poster size.  Then you just have the challenge of finding a
place to print it.

The pairs2 function in the TeachingDemos package will create pairs
like plots for subsets where the subset for the rows is different from
the subset for the columns.  So for example you could do something
like:

library(TeachingDemos)

pairs( mydata[,1:5])
pairs( mydata[, 6:10] )
pairs2( mydata[,1:5], mydata[,6:10 )
pairs2( mydata[,6:10], mydata[,1:5] )

then print out the 4 graphs and arrange them in a 2x2 grid to get an
overall 10x10 pairs plot.  Expand this more and you can create a nice
poster of all 40x40 plots of interest.  I used 5x5 for each pairs
plot, but you can choose what makes the most sense for your data.




On Tue, May 20, 2014 at 8:25 AM, Tim Richter-Heitmann
<trichter at uni-bremen.de> wrote:
> Hi there,
>
> i recently started to learn R to deal  with a huge data matrix to deal
> with with ecological data (about 40 observations in 360 samples, divided
> in 7 groups of similar samples). I want to do a simple pairs or ggpairs:
>
> pairs(mydata, pch=20, col=brewer.pal(7, "Dark2")[unclass(all$group)])
>
> ggpairs(mydata, colour="group") (preferred)
>
>
>
> Of course, the plot margins are way to small to produce a 40x40 plot
> matrix (or is there a way to create poster-sized plots?), so i need to
> produce 39 x,y scatter-plots for each single column and arrange them
> somehow. Is there a way to do it automatically (without creating 39
> single plots one by one?)
> Another option would be to only show plots with x,y pairs with
> correlation values above a certain treshold (i would need to create the
> cor-matrix first and identify those highly correlated pairs by myself,
> correct, or is there a way to tell R to do that?)
> And finally, ggpairs is giving me fits because the font size of the
> upper part does not change despite me trying to tell R to do so
> (params=list(corSize=10) or just params=list(Size=10) or
> upper=list(params=c(Size=10)).
>
>
> As i said i am a beginner and hopefully my questions are not too stupid.
>
> --
> Tim Richter-Heitmann (M.Sc.)
> PhD Candidate
>
>
>
> International Max-Planck Research School for Marine Microbiology
> University of Bremen
> Microbial Ecophysiology Group (AG Friedrich)
> FB02 - Biologie/Chemie
> Leobener Straße (NW2 A2130)
> D-28359 Bremen
> Tel.: 0049(0)421 218-63062
> Fax: 0049(0)421 218-63069
>
>
>         [[alternative HTML version deleted]]
>
>
> ______________________________________________
> 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.
>



-- 
Gregory (Greg) L. Snow Ph.D.
538280 at gmail.com



More information about the R-help mailing list