Tuesday, 18 February 2014

Help from Peter Morgan

Some info from Peter Morgan...


Hi Paul,

'Cleaned up' the data as attached then tried some things out as follows.  See what you think.

Cheers,

Pete

dt=read.csv("data/studentstats1.csv", header=TRUE)
summary(dt)
# cex makes markers bigger and pch sets the marker shape 
# las = 2 makes the labels go perpendicular to the axes
stripchart(data=dt,height~gender, pch="O", cex=1.5, las=2)
# varwidth sets the box area to be proportional to number of data in any category
# can also add more things to right hand side.e.g. height=gender+eye_colour 
boxplot(data=dt, height~gender, las=2, varwidth=TRUE)
require(lattice)
stripplot(data=dt,height~eye_colour|gender, pch="O", cex=2)
# space is in a list of key drawing parameters - see ?xyplot for details
stripplot(data=dt,height~gender,groups=eye_colour, pch="O", cex=2, auto.key=list( space="right") )
# neat thing to do would be to get colour names in variable to do the colouring!



No comments:

Post a Comment