histStack               package:prada               R Documentation

_S_t_a_c_k_e_d _h_i_s_t_o_g_r_a_m

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

     Stacked histogram

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

     histStack(x, breaks, midsFun=paste, ...) 

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

       x: A list of numeric vectors.

  breaks: Histogram breaks, as in 'hist'

 midsFun: Function, can be used to control the formatting and number of
          the bar labels on the x-axis. See example.

     ...: Further arguments that get passed to 'barplot'

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

     The function calls 'hist' for each element of 'x' and plots the
     frequencies as a stacked barplot using 'barplot' with
     'beside=FALSE'.

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

     The function is called for its side effect, producing a barplot on
     the active graphics device. It returns the result of the call to
     'barplot'.

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

     Wolfgang Huber <URL: http://www.ebi.ac.uk/huber>

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

       x    <- list(rnorm(42), rnorm(42)+2)
       br   <- seq(-3, 5, length=13)
       cols <- c("#1D267B", "#ceffc0")
       histStack(x, breaks=br, col=cols)

       histStack(x, breaks=br, col=cols,
                 midsFun=function(z) {
                   z <- paste(round(z, 3))
                   z[seq(2, length(z), by=2)] <- NA
                   return(z)
                 } )

