R.teachingdemos, faces()
It's easy to use faces()
function in the TeachingDemos of R. 开发者_JAVA百科But it really confuses me to read the faces. What on earth they indicate? What does each facial expression stand for?
The faces functions are generally best for general overviews of data and looking for unusual observations. If you run the example for the sliderv
function (TeachingDemos package) you can adjust each of the features interactively using sliders to see the effects in the plot.
Another example is:
data(UScereal, package='MASS')
faces(UScereal[,-c(1,9,11)])
Notice how some of the faces stick out as being different from others, these may warrant further investigation.
To really use this technique properly you should put a lot of thought into which variable matches which facial feature as some of the features are more subtle and some draw the eye quicker. Some variables may also want to be reverse coded. Sorting the rows of the data based on clustering algorythms or other features of the data may also be of interest.
It's a visualization of your matrix. Each face corresponds to a face and columns are denoted by the face morphology (face width/height, ear width/height, curve of a smile... see the documentation).
A short example that shows this (notice rbind
and cbind
) is
faces(rbind(rep(1, 3), rep(2, 3), rep(3, 3)))
faces(cbind(rep(1, 3), rep(2, 3), rep(3, 3)))
精彩评论