legends                 package:vcd                 R Documentation

_L_e_g_e_n_d _F_u_n_c_t_i_o_n_s _f_o_r _S_t_r_u_c_p_l_o_t_s

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

     These functions generate legend functions for residual-based
     shadings.

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

     legend_resbased(fontsize = 12,
       x = unit(1, "lines"), y = unit(0.1,"npc"),
       height = unit(0.8, "npc"),
       width = unit(0.7, "lines"),
       digits = 3, check_overlap = TRUE, text = NULL,
       steps = 200, ticks = 10, pvalue = TRUE)
     legend_fixed(fontsize = 12, x = unit(1, "lines"), y = NULL,
       height = NULL, width = unit(1.5, "lines"), steps = 200,
       digits = 1, space = 0.05, text = NULL)

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

fontsize: fontsize of title and p-value text.

    x, y: objects of class '"unit"' indicating the coordinates of the
          title. For 'legend_fixed', the default for 'y' is computed as
          to leave enough space for the specified 'text'.

height, width: object of class '"unit"' indicating the height/width of
          the legend. For 'legend_fixed', the default for 'y' is
          computed as to align upper margins of legend and actual plot.

  digits: number of digits for the scale labels.

check_overlap: logical indicating whether overlap of scale labels
          should be inhibited or not.

   space: For 'legend_fixed' only: proportion of space between the
          tiles.

    text: character string indicating the title of the legend.

   steps: granularity of the color gradient.

   ticks: number of scale ticks.

  pvalue: logical indicating whether the p-value should be visualized
          under the scale or not.

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

     These functions generate legend functions for residual-based
     shadings, visualizing deviations from expected values of an
     hypothesized independence model.  Therefore, the legend uses a
     supplied shading function to visualize the color gradient for the
     residuals range. 'legend_fixed' is inspired by the legend used in
     'mosaicplot'. For more details on the shading functions and their
     return values, see 'shadings'.

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

     A function with arguments: 

residuals: residuals from the fitted independence model to be
          visualized.

 shading: shading function computing colors from residuals (see
          details).

autotext: character vector indicating the title to be used when no
          'text' argument is specified. Allows strucplot to generate
          sensible defaults depending on the residuals type.

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

     David Meyer David.Meyer@R-project.org

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

     D. Meyer, A. Zeileis, K. Hornik (2003), Visualizing independence
     using extended association plots. _Proceedings of the 3rd
     International Workshop on Distributed Statistical Computing_, K.
     Hornik, F. Leisch, A. Zeileis (eds.), ISSN 1609-395X. <URL:
     http://www.ci.tuwien.ac.at/Conferences/DSC-2003/Proceedings/>

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

     'structable', 'shadings'

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

     mosaic(Titanic, shade = TRUE, legend = legend_resbased)
     mosaic(Titanic, shade = TRUE, legend = legend_fixed, gp = shading_Friendly)

