Last data update: 2014.03.03

R: Chernoff Faces
PlotFacesR Documentation

Chernoff Faces

Description

Plot Chernoff faces. The rows of a data matrix represent cases and the columns the variables.

Usage

PlotFaces(xy, which.row, fill = FALSE, nrow, ncol,
          scale = TRUE, byrow = FALSE, main, labels, print.info=FALSE, col=NA)

Arguments

xy

xy data matrix, rows represent individuals and columns attributes.

which.row

defines a permutation of the rows of the input matrix.

fill

logic. If set to TRUE, only the first nc attributes of the faces are transformed, nc is the number of columns of x.

nrow

number of columns of faces on graphics device

ncol

number of rows of faces

scale

logic. If set to TRUE, attributes will be normalized.

byrow

if(byrow==TRUE), x will be transposed.

main

title.

labels

character strings to use as names for the faces.

print.info

if TRUE information about usage of variables for face elements are printed.

col

a vector of colors used for the parts of the faces. Default is NA, which will omit colors.

Details

The features paramters of this implementation are:

  • 1 height of face

  • 2 width of face

  • 3 shape of face

  • 4 height of mouth

  • 5 width of mouth

  • 6 curve of smile

  • 7 height of eyes

  • 8 width of eyes

  • 9 height of hair

  • 10 width of hair

  • 11 styling of hair

  • 12 height of nose

  • 13 width of nose

  • 14 width of ears

  • 15 height of ears

Some faces

For details look at the literate program of faces

Value

a plot of faces is created on the graphics device, no numerical results

Note

version 12/2003

Author(s)

H. P. Wolf

References

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

The smooth curves are computed by an algorithm found in:
Ralston, A. and Rabinowitz, P. (1985) A first course in numerical analysis, McGraw-Hill, pp 76ff.
http://www.wiwi.uni-bielefeld.de/~wolf/: S/R - functions : faces

Examples

PlotFaces(rbind(1:3,5:3,3:5,5:7))

data(longley)
PlotFaces(longley[1:9,])

set.seed(17)
PlotFaces(matrix(sample(1:1000,128,),16,8),main="random faces")


means <- lapply(iris[,-5], tapply, iris$Species, mean)
m <- t(do.call(rbind, means))
m <- cbind(m, matrix(rep(1, 11*3), nrow=3))

PlotFaces(m, ncol=3, col=PalTibco())

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DescTools)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DescTools/PlotFaces.Rd_%03d_medium.png", width=480, height=480)
> ### Name: PlotFaces
> ### Title: Chernoff Faces
> ### Aliases: PlotFaces
> ### Keywords: hplot
> 
> ### ** Examples
> 
> PlotFaces(rbind(1:3,5:3,3:5,5:7))
> 
> data(longley)
> PlotFaces(longley[1:9,])
> 
> set.seed(17)
> PlotFaces(matrix(sample(1:1000,128,),16,8),main="random faces")
> 
> 
> means <- lapply(iris[,-5], tapply, iris$Species, mean)
> m <- t(do.call(rbind, means))
> m <- cbind(m, matrix(rep(1, 11*3), nrow=3))
> 
> PlotFaces(m, ncol=3, col=PalTibco())
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>