I've got a dataset that looks like this...
mine tonnes week AA 112 41 AA 114 41 AA 119 41 BB 108 41 BB 112 41 AA 110 42 AA 109 42 AA 102 43 AA 101 43
And I want to create a boxplot in ggplot2 to show the distribution of tonnes for each week. But I only want results from mine AA.
I thought it would work like this....
qplot(factor(week), tonnes[mine == "AA"], data = sql_results, geom = "boxplot")
But instead, I get this error.
Error in data.frame(x = c(13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, :
arguments imply differing number of rows: 423100, 109436
It's probably dead simple, but I'm not having much luck figuring the right way to do this.