histbackback              package:Hmisc              R Documentation

_B_a_c_k _t_o _B_a_c_k _H_i_s_t_o_g_r_a_m_s

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

     Takes two vectors or a list with 'x' and 'y' components, and
     produces  back to back histograms of the two datasets.

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

     histbackback(x, y, brks=NULL, xlab=NULL, axes=TRUE, probability=FALSE,
                  xlim=NULL, ylab='', ...)

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

     x,y: either two vectors or a list given as 'x' with two
          components.  If the components have names, they will be used
          to label the axis (modification FEH). 

    brks: vector of the desired breakpoints for the histograms. 

    xlab: a vector of two character strings naming the two datasets. 

    axes: logical flag stating whether or not to label the axes. 

probability: logical flag: if 'TRUE', then the x-axis corresponds to
          the units for a density.  If 'FALSE', then the units are
          counts. 

    xlim: x-axis limits.  First value must be negative, as the left
          histogram is placed at negative x-values.  Second value must
          be positive, for the right histogram.  To make the limits
          symmetric, use e.g. 'ylim=c(-20,20)'. 

    ylab: label for y-axis.  Default is no label. 

     ...: additional graphics parameters may be given. 

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

     a list is returned invisibly with the following components:

    left: the counts for the dataset plotted on the left. 

   right: the counts for the dataset plotted on the right. 

  breaks: the breakpoints used. 

_S_i_d_e _E_f_f_e_c_t_s:

     a plot is produced on the current graphics device.

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

     Pat Burns 
      Salomon Smith Barney 
      London 
      pburns@dorado.sbi.com

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

     'hist', 'histogram'

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

     options(digits=3)
     set.seed(1)
     histbackback(rnorm(20), rnorm(30))

     fool <- list(x=rnorm(40), y=rnorm(40))
     histbackback(fool)
     age <- rnorm(1000,50,10)
     sex <- sample(c('female','male'),1000,TRUE)
     histbackback(split(age, sex))
     agef <- age[sex=='female']; agem <- age[sex=='male']
     histbackback(list(Female=agef,Male=agem), probability=TRUE, xlim=c(-.06,.06))

