densityplot              package:Simple              R Documentation

_P_l_o_t_s _d_e_n_s_i_t_i_e_s _o_f _d_a_t_a

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

     Allows one to compare empirical densities of different
     distributions in a simple manner. The density is used as graphs
     with multiple histograms are too crowded. The usage is similar to
     side-by-side boxplots.

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

     densityplot(x, ...)

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

       x: x may be a sequence of data vectors (eg. x,y,z), a data frame
           with numeric column vectors or a model formula

     ...: You can pass in a bandwidth argument such as bw="SJ". See 
          density for details. A legend will be placed for you
          automatically. To  overide the positioning set
          do.legend="manual". To skip the legend, set do.legend=FALSE. 

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

     Makes a plot

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

     John Verzani

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

     Basically a modified boxplot function. As well it should be  as it
     serves the same utility: comparing distributions.

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

     'boxplot','violinplot','density'

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

     ## taken from boxplot
     ## using a formula
     data(InsectSprays)
     densityplot(count ~ spray, data = InsectSprays)
     ## on a matrix (data frame)
     mat <- cbind(Uni05 = (1:100)/21, Norm = rnorm(100),
                  T5 = rt(100, df = 5), Gam2 = rgamma(100, shape = 2))
     densityplot(data.frame(mat))

