faces2             package:TeachingDemos             R Documentation

_C_h_e_r_n_o_f_f _F_a_c_e_s

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

     Plot Chernoff Faces of the dataset, rows represent
     subjects/observations, columns represent variables.

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

     faces2(mat, which = 1:ncol(mat), labels = rownames(mat),
       nrows = ceiling(nrow(mat)/ncols), ncols = ceiling(sqrt(nrow(mat))),
       byrow = TRUE, scale = c("columns", "all", "center", "none"),
       fill = c(0.5, 0.5, 1, 0.5, 0.5, 0.3, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
                0.5, 0.5, 0.5, 0.5, 1, 0.5), ...)

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

     mat: Matrix containing the data to plot. 

   which: Which columns correspond to which features (see details). 

  labels: Labels for the individual faces 

   nrows: Number of rows in the graphical layout 

   ncols: Number of columns in the graphical layout 

   byrow: Logical, should the faces be drawn rowwise or columnwise. 

   scale: Character, how should the data be scaled. 

    fill: What value to use for features not assocaiated with a column
          of data. 

     ...: Additional arguments passed on to plotting functions. 

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

     The features are: 1  Width of center 2  Top vs. Bottom width
     (height of split) 3  Height of Face 4  Width of top half of face 5
      Width of bottom half of face 6  Length of Nose 7  Height of Mouth
     8  Curvature of Mouth (abs < 9) 9  Width of Mouth 10 Height of
     Eyes 11 Distance between Eyes (.5-.9) 12 Angle of Eyes/Eyebrows 13
     Circle/Ellipse of Eyes 14 Size of Eyes 15 Position Left/Right of
     Eyeballs/Eyebrows 16 Height of Eyebrows 17 Angle of Eyebrows 18
     Width of Eyebrows

     The face plotting routine needs the data values to be between 0
     and 1 (inclusive).  The 'scale' option controls how scaling will
     be done on 'mat':  "columns" scales each column to range from 0 to
     1, "all" scales the entire dataset to vary from 0 to 1, "center"
     scales each column so that the mean of the column becomes 0.5 and
     all other values are between 0 and 1, and "none" does no scaling
     assuming that the data has already been scaled.

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

     This function is run for its side effect of plotting and does not
     return anything.

_N_o_t_e:

     If you choose to not scale the data and any data values are
     outside of the 0 to 1 range, then strange things may happen.

     This function is based on code available at <URL: >, the good
     things come from there, any problems are likely due to my (Greg's)
     tweaking.

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

     Original code by  ; current implementation by Greg Snow
     greg.snow@intermountainmail.org

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

     Chernoff, H. (1973): The use of faces to represent statistiscal
     assoziation, JASA, 68, pp 361-368.

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

     'faces'

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

       faces2(matrix( runif(18*10), nrow=10), main='Random Faces')

