[R] [R-pkgs] GGally - Plot Matrix Extension for GGplot2

Barret Schloerke barret at barretschloerke.com
Thu Jan 21 20:37:24 CET 2010


GGally:  a companion to GGplot2.

GGally is a package built to produce plot matrices without the hassle
of making viewports and labels yourself.  GGally is built upon the
GGplot2 framework.  Keeping the functionality and feel of ggplot,
GGally has shortened common function calls and added a few new ones.

ggpairs, the main function within GGally, will take your data set and
produce a plots according to the data types given. ggpairs will
produce four different types of plots: continuous-continuous,
continuous-discrete, discrete-continuous, discrete-discrete.  The
function will determine which type is needed and produce a plot
according the the specified type given.  General aesthetics can be
applied to the whole plot matrix.

This package was developed as an add on package to keep the base
functionality of GGplot2 separate.

Examples:
  #plot matrix of all five variables in iris
  ggpairs(iris)

  # Make a ggpairs object with
  #  the upper triangle containing 2D density plots and box plots,
  #  the lower triangle containing scatter plots and dod plots,
  #  the diagonal containing histograms.
  # The color of each plot, if applicable, will be done accordingly to "cut"
  #
  diamondMatrix <- ggpairs(	
    diamonds[,1:3], 	
    upper = list(continuous = "density", combo = "box"), 	
    lower = list(continuous = "points", combo = "dot"), 	
    diag = list(continuous = "bar", discrete = "bar"),
    color = "cut",
    filled = TRUE,
    title = "Diamonds"
  )
  # print the plot matrix
  diamondMatrix

- Barret Schloerke, Dianne Cook, Heike Hofmann, Hadley Wickham

_______________________________________________
R-packages mailing list
R-packages at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages



More information about the R-help mailing list