I'm a little new to R and very new to ggplot but I've encountered an issue with geom_boxplot():
I'm trying to draw boxplots of sequence length data, separated by sample type. The sequence lengths are all integers and the sample types have been stored as factors. The command:
> ggplot(database, aes(x = SampleType, Y = Length), geom_boxplot())
draws a blank graph, with the appropriate X and Y axes, but no plots at all! So clearly it knows the limits of the Length variable (axes cutoffs are appropriate given my data) but is absolutely refusing to put boxplots on the graph!
Strangely, the command:
> ggplot(database) + geom_boxplot(aes(x = SampleType, Y = Length))
works!
I've tested ggplot on other datasets and both commands work fine, so its clearly just a problem with me!
I was hoping someone could tell me the difference between the two syntaxes, and potentially why one works when the other doesn't?
Thanks!