Chernoff Faces from aplpack
I’ve been playing around with the faces function from the R package aplpack. I haven’t used it in a while, but there are some new features that I’ve either never noticed before or they are new. Color has been added to the faces and you can now plot the faces. There is also the superfluously fantastic option of displaying the faces as Santa Claus.
Here are some of my examples:
Golf: Statistics from several of my friends collected via oobgolf.com. (I’m SITW on the lower right.) The face is handicap, the mouth is scoring average, the eyes are average putts, the hair is the percentage of fairways hit, nose is greens in regulation (GIR), and ears are the total number of rounds you play. The faces are plotted with fairway percentage on the x-axis and GIR on the y-axis.
Santa_Golf: Same golf data with Santa option.
NFL2010: Final NFL regular season team statistics. The face represent the offense and the defense is represented by hair. The size of the nose indicates sacks, the ears indicate turnovers (ear width is interceptions; ear height is forced fumbles). The eyes indicate penalties and, finally, the size of the mouth indicates wins with a smiling face if the team made the playoffs (a really nice touch, if you ask me.) The face at the bottom right indicates the league leader.
Some observations on the NFL faces: The two superbowl teams last year (Pittsburgh and Green Bay) are both located at the bottom of the graph and there faces look very, very similar. San Diego looks similar to to both Green Bay and Pittsburgh (similar face, nose, eyes, and hair), but the big differences are the ears and, of course, the San Diego face is frowning. Another thing that pops out at me is how similar Houston and New England look to each other. They have very similar face shape, eyes, and hair. The big differences are the nose and ears (sacks and turnovers).
##Playoff Teams: creating a playoff indicator
##Finding the league leader in all variables
##Defining the names
names(x)[c(13,14,15,16)]<-c(“Off PPG”,”Off YPG”,”Off Pass”,”Off Rush”)
names(x)[c(26:29)]<-c(“Def PPG”,”Def YPG”,”Def Pass”,”Def Rush”)
names(x)[c(5:6)]<-c(“Points For”,”Points Against”)
##Columns used for plotting
##Offense = face, Defense = hair, penalty= eyes, Wins and playoffs = mouth, turnovers = ears
##Columns used for faces: which columns am i going to use for the data
##creating the faces without plotting them.
##creating text for the legend
##building the plot
plot(x[,plot.cols],bty=”n”,xlim=c(200,600),main=”2010 NFL Season”)
##plotting the faces