Skip to content

Instantly share code, notes, and snippets.

@jlehtoma
Created January 27, 2012 17:04
Show Gist options
  • Save jlehtoma/1689808 to your computer and use it in GitHub Desktop.
Save jlehtoma/1689808 to your computer and use it in GitHub Desktop.
Melt + Boxplot
library(reshape)
pop <- c("P","P","M","M")
C <- c(5,3,6,2)
Pr <- c(6,5,1,4)
Fr <- c(4,5,1,1)
Gr <- c(9,4,2,8)
mydata <- data.frame(pop=pop, C=C, Pr=Pr, Fr=Fr, Gr=Gr)
mdata <- melt(mydata, id=c("pop"))
boxplot(value~pop*variable, data=mdata,
main="Test", xlab="Blaah")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment