chplot                package:chplot                R Documentation

_A_u_g_m_e_n_t_e_d _C_o_n_v_e_x _H_u_l_l _P_l_o_t

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

     Plots 2D convex hulls or bivariate density contours, one for each
     group of data. Descriptive statistics are plotted as error bars or
     confidence ellipses within convex hulls. Marginal distributions as
     well as a special legend are added by default. Additionally, area
     of convex hull per point can be displayed.

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

     chplot(x,y,groups,chull=TRUE,clevel=0.95,band.power=.2,
     mar.den=FALSE,descriptives="mean.sd",dlevel=0.68,bw=FALSE,ratio=.75,
     plot.points=FALSE,log="",xlab,ylab,legend,...)

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

       x: a matrix of three columns, representing the x and y
          coordinates and the grouping variable, respectively.
          Alternatively, 'x' can have just two columns (the second is
          regarded as y) or just be a vector of x coordinates. If 'x'
          is a data.frame, the names of the variables are used for the
          axes and legend title. 

       y: the y coordinates of points in the plot, optional if 'x' is
          an appropriate structure. 

  groups: group codes of points in the plot, optional if 'x' is an
          appropriate structure. 

   chull: logical; if 'TRUE' (default), convex hulls are plotted,
          otherwise density contours are drawn. 

  clevel: the confidence level for the density plot if 'chull=FALSE'
          (default is 0.95). 

band.power: applies if 'chull=FALSE'; bandwidth for bivariate density
          estimation is calculated as '(group size)^(-band.power)' for
          each group (default is 0.2). 

 mar.den: logical; defines the nature of marginal distribution plots.
          If 'FALSE' (default), relative frequency polygons are
          plotted, otherwise density plots are drawn. 

descriptives: the option to be used for depicting descriptive
          statistics. The default value is 'mean.sd', which produces a
          cross with the lines intersecting at the mean of 'x' and 'y'
          for each group and depicting the 68-percent tolerance
          interval (i.e., stretching one standard deviation in each
          direction) with default 'dlevel' setting. Option 'mean.se'
          does the same with standard errors of the means, while
          'median' makes the lines one quartile long in each direction
          and cross at the median. Option 'ellipse' plots confidence
          ellipses. 

  dlevel: the tolerance/confidence level applied if
          'descriptives=mean.sd' or 'mean.sd'. 

      bw: logical; if 'TRUE', the plot is produced in black-and-white.
          The default is 'FALSE', which plots in colour. 

   ratio: the ratio of the main plot to the whole figure region. The
          default value is 0.75. If equal to 1, the marginal
          distributions are not plotted. If the ratio is less or equal
          to 0.75, the default legend position is outside the main plot
          (i.e., in the top right corner), otherwise it is within the
          main plot (i.e., to be selected by the user with mouse). 

plot.points: logical; if 'true', the points are drawn in addition to
          the convex hulls or density contours. 

     log: the character strings '"x"', '"y"' or '"xy"' makes a specific
          (or both) axes logarithmic; the default, which does nothing,
          is '""'. 

    xlab: a title for the x axis in the main plot; the default is the
          name of the x variable. 

    ylab: a title for the y axis in the main plot; the default is the
          name of the y variable. 

  legend: object of class 'legend.control' specifying various
          parameters for the legend. Default is 'legend.control(...)'.  

     ...: other arguments will be passed to 'legend.control'

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

     The relative frequency polygons chosen with 'mar.den=FALSE'
     connect the points in the middle of the intervals and the starting
     and ending interval with zero frequency in each group. All the
     frequencies are rescaled in order to make the plots immediately
     comparable (the same is true for the density curves).

     The default density contour might not fit into the plot - this can
     be avoided by decreasing the 'clevel'. In such cases the area does
     not provide a sensible measure.

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

     a list with components: 

    usrc: the limits of the central plotting region.

    usru: the limits of the top left plotting region.

    usrr: the limits of the bottom right plotting region.

   ratio: the ratio used.

 is.xlog: logical, denoting whether either 'log="x"' or  'log="xy"' was
          used.

 is.ylog: logical, denoting whether either 'log="y"' or  'log="xy"' was
          used.

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

     'chadd', 'chull', 'bkde2D', 'legend.control'.

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

     # the hdr dataset
     data(hdr)
     chplot(hdr,log="x")
     # the iris dataset
     data(iris)
     chplot(iris[,c(1,2,5)],bw=TRUE,legend.control(cex=.6))

