I'm still pretty new to R, and have come up against a plotting problem I can't find an answer to.
I've got a data frame that looks like this (though a lot bigger):
df <- data.frame(Treatment= rep(c("A", "B", "C"), each = 6),
ggplot(data = df, aes(x=Treatment, y=LocA, color = Treatment)) + geom_point()
As a couple of people have mentioned, you need to "melt" the data, getting it into a "long" form.
library(reshape2) df_melted <- melt(df, id.vars=c("Treatment")) colnames(df_melted) <- "Location"
In ggplot jargon, having different groups like treatment side-by-side is achieved through "dodging". Usually for things like barplots you can just say
geom_point seems to require a bit more manual specification:
ggplot(data=df_melted, aes(x=Location, y=value, color=Treatment)) + geom_point(position=position_dodge(width=0.3))