tile                   package:vcd                   R Documentation

_T_i_l_e _P_l_o_t

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

     Plots a tile display.

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

     ## Default S3 method:
     tile(x,
              tile_type = c("squaredarea", "area", "height", "width"),
              halign = c("left", "center", "right"),
              valign = c("bottom", "center", "top"),
              split_vertical = NULL,
              shade = FALSE,
              spacing = spacing_equal(unit(1, "lines")),
              set_labels = NULL,
              margins = unit(3, "lines"),
              keep_aspect_ratio = FALSE,
              legend_width = NULL,
              squared_tiles = TRUE,
              main = NULL, sub = NULL, ...)
     ## S3 method for class 'formula':
     tile(formula, data,
       ..., main = NULL, sub = NULL, subset = NULL, na.action = NULL)

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

       x: a contingency table, or an object coercible to one.

 formula: a formula specifying the variables used to create a 
          contingency table from 'data'

    data: either a data frame, or an object of class '"table"' or
          '"ftable"'.

  subset: an optional vector specifying a subset of observations to be
          used.

na.action: a function which indicates what should happen when the data
          contain 'NA's. Ignored if 'data' is a contingency table.

tile_type: character string indicating how the tiles should reflect the
          table frequencies (see details).

halign, valign: character string specifying the horizontal and vertical
          alignment of the tiles.

split_vertical: vector of logicals of length k, where k is the number
          of margins of 'x' (values are recycled as needed). A 'TRUE'
          component indicates that the tile(s) of the corresponding
          dimension should be split vertically, 'FALSE' means
          horizontal splits. Default is 'FALSE.'

 spacing: spacing object, spacing function, or corresponding generating
          function (see 'strucplot' for more information).

set_labels: An optional character vector with named components
          replacing the so-specified variable names. The component
          names must exactly match the variable names to be replaced.

   shade: logical specifying whether shading should be enabled or not
          (see 'strucplot').

 margins: either an object of class '"unit"' of length 4, or a numeric
          vector of length 4. The elements are recycled as needed. The
          four components specify the top, right, bottom, and left
          margin of the plot, respectively. When a numeric vector is
          supplied, the numbers are interpreted as '"lines"' units.  In
          addition, the unit or numeric vector may have named arguments
          ('top', 'right', 'bottom', and 'left'), in which case the
          non-named arguments specify the default values (recycled as
          needed), overloaded by the named arguments.

legend_width: An object of class '"unit"' of length 1 specifying the
          width of the legend (if any). Default: 5 lines.

keep_aspect_ratio: logical indicating whether the aspect ratio should
          be fixed or not. The default is 'FALSE' to enable the
          creation of squared tiles.

squared_tiles: logical indicating whether white space should be added
          as needed to rows or columns to obtain squared tiles in case
          of an unequal number of row and column labels.

main, sub: either a logical, or a character string used for plotting
          the main (sub) title.  If logical and 'TRUE', the name of the
          'data' object is used.

     ...: Other arguments passed to 'strucplot'

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

     A tile plot is a matrix of tiles. For each tile, either the
     '"width"', '"height"', '"area"', or squared area is proportional
     to the corresponding entry. The first three options allow
     column-wise, row-wise and overall comparisons, respectively. The
     last variant allows to compare the tiles both column-wise and
     row-wise, considering either the width or the height,
     respectively.

     In contrast to other high-level strucplot functions, 'tile' also
     accepts a table with duplicated levels (see examples). In this
     case, artificial dimnames will be created, and the actual ones are
     drawn using 'set_labels'.

     Note that multiway-tables are first "flattened" using
     'structable'.

_V_a_l_u_e:

     The '"structable"' visualized is returned invisibly.

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

     David Meyer David.Meyer@R-project.org

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

     'assoc', 'strucplot', 'mosaic', 'structable',

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

     data("Titanic")

     ## default plot
     tile(Titanic)
     tile(Titanic, type = "expected")
     tile(Titanic, shade = TRUE)

     ## some variations
     tile(Titanic, tile_type = "width", squared_tiles = FALSE)
     tile(Titanic, tile_type = "height", squared_tiles = FALSE)
     tile(Titanic, tile_type = "area", halign = "center", valign = "center")

     ## repeat levels
     tile(Titanic[,,,c(1,2,1,2)])

