barcode             package:YaleToolkit             R Documentation

_B_a_r_c_o_d_e _p_l_o_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Produce barcode plot(s) of the given (grouped) values.

_U_s_a_g_e:

     barcode(x, outer.margins = list(bottom = unit(2, "lines"),
                                     left = unit(2, "lines"), 
                                     top = unit(2, "lines"), 
                                     right = unit(2, "lines")), 
             horizontal = TRUE, xlim = NULL, nint = 0, main = "", xlab = "", 
             labelloc = TRUE, axisloc = TRUE, labelouter = FALSE, 
             newpage = TRUE, fontsize = 9, ptsize = unit(0.25, "char"), 
             ptpch = 1, bcspace = NULL, use.points = FALSE, buffer = 0.02,
             log = FALSE)

     barcode.panel(x, horizontal = TRUE, xlim = NULL, labelloc = TRUE, axisloc = TRUE, 
                   labelouter = FALSE, nint = 0, fontsize = 9, 
                   ptsize = unit(0.25, "char"), ptpch = 1, bcspace = NULL, 
                   xlab = "", xlaboffset = unit(2.5, "lines"), 
                   use.points = FALSE, buffer = 0.02, log = FALSE)

_A_r_g_u_m_e_n_t_s:

       x: a vector of values for which the barcode is desired, or a
          list of such vectors for ``side-by-side" barcodes. Matrices
          are coerced to data frames and treated as lists 'NA''s are
          allowed in the data.

outer.margins: a list of length 4 with units as components named
          bottom, left, top, and right, giving the outer margins.
          Defaults to two lines of text.

horizontal: logical indicating the barcode orientation; the default,
          'TRUE', produces horizontal barcodes.

    xlim: the 'x' limits '(xmin, xmax)' of the plot; the default,
          'NULL', uses the range of the full data, 'range(unlist(x))',
          plus the multiplicative 'buffer'.

    nint: default, 0, uses no ``binning''- i.e., the barcode presents
          the exact measurements, to the precision of the data set;
          'nint=100' uses roughly 100 ``bins'' in constructing the
          barcode; fewer bins give a more histogram-like plot.

    main: the plot title.

    xlab: the axis label for the quantitative measurements.

labelloc: for the location of the factor labels of the barcodes;
          default 'TRUE' may also be specified as ''left'' or ''top''
          (having similar results but relating to the horizontal
          alignment); values ''right'' or ''bottom'' are available as
          alternatives to 'FALSE'.

 axisloc: for the location of the quantitative axis labels; default,
          'TRUE', may also be specified as ''left'' or ''top'' (having
          similar results but relating to the horizontal alignment);
          values ''right'' or ''bottom'' are available as alternatives
          to 'FALSE'.

labelouter: default, 'FALSE', positions all labels within the viewport;
          'TRUE' forces the barcodes to the edge of the viewport, with
          the labels outside the viewport. May be of use to advanced
          users.

 newpage: default, 'TRUE', creates the barcodes in a new graphics
          device instead of adding the plot to the current viewport.

fontsize: for the size of the axis and factor labels.

  ptsize: for the size of the plotted points.

   ptpch: for the type of plotted points.

 bcspace: indicates the proportion of total available space occupied by
          the barcode part of the displays. Can range from 0 to 1;
          reasonable values seem to be between 0.1 and 0.5.

use.points: default FALSE uses segments instead of points in the
          histogram-style display.

xlaboffset: used for tuning the position of the label of the
          quantitative variable; needs to be a 'unit'.

  buffer: an additional proportion of empty space added to the right
          and left of the barcode, to avoid having the maximum and
          minimum on the frame of the plot.

     log: if 'TRUE', use the log scale for the y-axis of the
          histogram-like part of the barcodes.

_D_e_t_a_i_l_s:

     The barcode plot aids in comparing distributions. It shares some
     of the characteristics of side-by-side histograms or boxplots, and
     of rugs or stripplots. We have found it particularly useful with
     clumped data, when other methods obscure detail.

_N_o_t_e:

     John Hartigan designed and implemented an early version of the
     barcode plot. This implementation using 'grid' graphics adds some
     useful options and is better suited for general distribution.

_A_u_t_h_o_r(_s):

     John W. Emerson and Walton Green

_R_e_f_e_r_e_n_c_e_s:

     Chambers, J. M. and Hastie, T. J. (1992) {\it Statistical Models
     in S}. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'gpairs', 'rug', 'stripplot'

_E_x_a_m_p_l_e_s:

     # Simulate some data:
     x <- list(Rounded.2=round(rnorm(500, 2, 1),2),
               SmallerLevel=c(rnorm(100), rnorm(100,4,1)),
               LargerBivariateRounded.4=round(c(rnorm(500), rnorm(500,3,1)),4))

     barcode(x)
     barcode(x, main="Different orientatation", horizontal=FALSE)

     data(NewHavenResidential)
     barcode(split(NewHavenResidential$dep, NewHavenResidential$zone),
             xlab="Percent Depreciation", 
             main=paste("New Haven Residential Depreciation by Residential Zone",
                  "RS = Single Family, RM = Mixed Residential", sep = "\n"))

