######################################################################## # # John W. Emerson # Department of Statistics # Yale University # # Walton Green # Department of Geology and Geophysics # Yale University # ######################################################################## ######################################################################## ## Copyright (C) 2006 John W. Emerson ## ## This document is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## A copy of the GNU General Public License is available via WWW at ## http://www.gnu.org/copyleft/gpl.html. You can also obtain it by ## writing to the Free Software Foundation, Inc., 675 Mass Ave, ## Cambridge, MA 02139, USA. ## ## Bug reports to john.emerson@yale.edu ######################################################################## ######################################################################## # # library(vcd) contains a grid implementation of mosaic plots, an # alternative to the default mosaicplot() originally implemented by # Emerson and included in the base distribution. # # We extend the pairs() framework in a logical way: a data frame # may contain any combination of continuous and categorical variables. # Our pairs() tiles contain scatterplots, boxplot, or mosaic plots, # as is appropriate. Additional options are provided. # ######################################################################## ######################################################################## # gpairs package:gpairs R Documentation # # Generalized Pairs Plots # # Description: # # Produces a matrix of plots showing pairwise relationships between # quantitative and categorical variables in a complex data set. # # Usage: # # gpairs(x, ...) # # # Arguments: # # x: a data frame (or matrix the relationships between whose columns are # to be examined). Any combination of quantitative and categorical # variables is acceptable. # # outer.margins: a list of length 4 with units as components named # bottom, left, top, and right, giving the outer margins. Defaults # are two lines of text. TO DO: IF GIVEN AS A VECTOR # SHOULD BE FILLED IN WITH LINES AS DEFAULT UNIT. # # outer.labels: default is NULL, for alternating axis labels around # the perimeter. If 'all', all labels are printed, and if # 'none' no labels are printed. # # outer.rot: a 2-vector (x, y) rotating the left and right outer labels # x degrees and the top and bottom outer labels y degrees. Only # implemented for scatterplot and boxplot tile axis labels. # # gap: the gap between the tiles; defaulting to 0.05 of the width of a tile. # TO DO: CURRENTLY MUST BE A NUMBER INTERPRETED IN NPC UNITS. # # buffer: the fraction by which to expand the range of quantitative # variables to provide plots that will not truncate plotting symbols. # Defaults to 0 (%) currently. TODO: IMPLEMENT IN OTHER WAYS AND # suppert the same in barcode(). # # stat.pars: NULL # fontsize 7 # signif 0.05 # # scatter.pars: NULL # pch 1 # size unit(0.25, 'char') # col 'black' # # bwplot.pars: NULL # # stripplot.pars: NULL # pch 1 # size unit(0.5, 'char') # col 'black' # jitter FALSE # # mosaic.pars: NULL # # axis.pars: NULL # n.ticks 5 # fontsize 9 # # diag.pars: NULL # fontsize 9 # show.hist TRUE # hist.color 'black' # # upper.pars: NULL # lm.plot FALSE # ci.plot FALSE # loess.plot = FALSE # symlm.plot = FALSE # lm.stats = FALSE # corrgram = FALSE # barcode = TRUE # stripplot = FALSE # # lower.pars: NULL # lm.plot = FALSE # ci.plot = FALSE # loess.plot = FALSE # symlm.plot = FALSE # lm.stats = FALSE # corrgram = FALSE # barcode = TRUE # stripplot = FALSE # qqplot = TRUE iff all other lower.pars are FALSE # # whatis: FALSE # # Details: # # Plotting viewport must be square, currently, because of problems with # rotations of mosaic tiles and barcodes. # # Value: # # If whatis=TRUE, the value is a data frame containing variable names, # types, numbers of missing values, numbers of distinct values, precisions, # maxima and minima. # # Note: # # Author(s): # # John Emerson and Walton Green # # See Also: # # 'pairs', 'mosaicplot', 'barcode', 'lattice:splom', 'vcd:strucplot', 'whatis' # # References: # # "Mosaic Displays in S-PLUS: A General Implementation and a Case Study." # John W. Emerson, Statistical Computing and Graphics Newsletter, Vol. 9, # No. 1, 1988. # Graphical Analysis of Multiresponse Data: Illustrated with a Plant # Breeding Trial. Basford, K.E. and Tukey, J.W. (1999). # # # Examples: # source("barcode.txt") source("gpairs.txt") source("whatis.txt") y <- data.frame(A=c(rep("red", 100), rep("blue", 100)), B=c(rnorm(100),round(rnorm(100,5,1),1)), C=runif(200), D=c(rep("big", 150), rep("small", 50)), E=rnorm(200)) gpairs(y, upper.pars=list(barcode=TRUE), whatis=TRUE)