[R] Illustrating kernel distribution in wheat ears

Jason Smith devjason at gmail.com
Mon Jan 11 20:11:33 CET 2010

Here is how I tried to do a simple side-by-side boxplot:

# Create new dataframe (cultivar, values, idx)
# cbind goes by column so the cn column is repeated for us
cultivars <- cbind(cultivar=wheat$cn, stack(wheat[2:15]))
boxplot(values ~ cultivar, data=cultivars,
	main="Kernel distribution", xlab="Cultivar", ylab="Count")

This approach generated different boxplots than what I saw I with Jim's,
but I could be doing something incorrectly.


More information about the R-help mailing list