useOuterStrips         package:latticeExtra         R Documentation

_P_u_t _S_t_r_i_p_s _o_n _t_h_e _B_o_u_n_d_a_r_y _o_f _a _L_a_t_t_i_c_e _D_i_s_p_l_a_y

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

     Tried to update a '"trellis"' object so that strips are only shown
     on the top and left boundaries when printed, instead of in every
     panel as is usual.  This is only meaningful when there are exactly
     tow conditioning variables.

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

     useOuterStrips(x,
                    strip = strip.default,
                    strip.left = strip.custom(horizontal = FALSE))

     resizePanels(x, h = 1, w = 1)

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

       x: An object of class '"trellis"'. 

strip, strip.left: A function, character string or logical that would
          be appropriate 'strip' and 'strip.left' arguments
          respectively in a high level lattice function call (see
          'xyplot') 

       h: numeric vector specifying panel heights

       w: numeric vector specifying of panel widths

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

     'useOuterStrips' modifies a '"trellis"' object with
     'length(dim(x)) == 2' so that when plotted, strips are only shown
     on the top and left boundaries of the panel layout, rather than on
     top of every panel, as is the usual behaviour.

     'resizePanels' modifies a '"trellis"' object so that when plotted,
     the panels have the specified relative width and height; this is
     only interesting when 'h' or 'w' are vectors with unequal entries.
      'resizePanels' can be called with no arguments, in which case the
     currently plotted '"trellis"' object (if any) is used for 'x', and
     a suitable 'h' or 'w' (based on the current panel layout) is
     chosen so that sizes are relative to the current panel ranges in
     the native coordinate system.  This is only interesting when
     'scales="free"'; the resulting object, when plotted again, will
     have varying panel sizes but the same number of data units per
     inch in all panels.

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

     An object of class '"trellis"'; essentially the same as 'x', but
     with certain properties modified.

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

     Deepayan Sarkar

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

     'Lattice', 'xyplot'

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

     library(lattice)

     mtcars$HP <- equal.count(mtcars$hp)

     useOuterStrips(xyplot(mpg ~ disp | HP + factor(cyl), mtcars))

     useOuterStrips(xyplot(mpg ~ disp | factor(cyl) + HP, mtcars),
                    strip.left = FALSE,
                    strip = strip.custom(style = 4))

     state <- data.frame(state.x77, state.region, state.name)
     state$state.name <- 
         with(state, reorder(reorder(state.name, Frost), 
                             as.numeric(state.region)))
     dpfrost <- 
         dotplot(state.name ~ Frost | reorder(state.region, Frost),
                 data = state, layout = c(1, 4),
                 scales = list(y = list(relation = "free")))

     ## approximate
     resizePanels(dpfrost,
                  h = with(state, table(reorder(state.region, Frost))))

     ## exact (including boundary padding)
     resizePanels()

