To plot a ggplot2 Boxplot you can take a look at the following snippet.
require(foreign) require(MASS) require(bootES) library(ggplot2) library(plyr)# might be not needed here anyway it is a must-have package I think in R library(reshape2)# to "melt" your dataset library (scales)# it has a "rescale" function which is needed in heatmaps library(RColorBrewer)# for convenience of heatmap colors, it reflects your mood sometimes require(beanplot) library(plyr)# For the desc() function library(ggplot2) library(crop) library(directlabels) library(scales) library(grid) library(moments)
### Load your data here ## I loaded here data named"NewCalculation".
ggplot2_boxplot.jpg [ 39.75 KiB | Viewed 3771 times ]
In this example, I actually print multiple boxplots from the data same data-frame. I used the x-axis by passing the "factor(trainingSize)" to aes function. Filled the boxplots with yellow color using "fill=...". The other parameters as just the traditional ones for any ggplot function.
_________________ M. S. Rakha, Ph.D. Queen's University Canada