Hi:
First of all, please learn how to post data to the group. The preferred mode is dput() form, as in
> dput(DF)
structure(list(Day = c(4L, 7L, 9L, 11L, 14L), Mussel = c(6.3,
6.73, 6.47, 6.47, 6.7), Water = c(6.6, 7.3, 6.94, 6.94, 6.83)), .Names = c("Day",
"Mussel", "Water"), class = "data.frame", row.names = c(NA, -5L
))
It makes more sense to use the actual numeric days than factor levels, so I edited your data so that days were numeric (i.e., the D was removed). You then want to melt the data so each variable can be plotted separately, after which you can pass it into ggplot2.
DF <- read.table(header = TRUE, text = "
Day Mussel Water
4 6.3 6.6
7 6.73 7.3
9 6.47 6.94
11 6.47 6.94
14 6.7 6.83")
library(reshape2)
DFm <- melt(DF, id = "Day")
library(ggplot2)
ggplot(DFm, aes(x = Day, y = value, color = variable)) +
theme_bw() +
geom_line(size = 1) + geom_point(size = 2.5) +
labs(x = "Day of analysis", y = "pH", color = "")