Hello, I have a dataframe with measurements stratified by the concentration of a certain substance. I would like to plot the points of the measures and connect the points within each series of concentrations. When I launch ggplot2 I get the error ``` geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic? ``` and no lines are drawn. Where am I going wrong? Thank you Luigi
``` df = data.frame(Conc = c(rep(1, 3), rep(2, 3), rep(5, 3)), Time = rep(1:3, 3), Value = c(0.91, 0.67, 0.71, 0.91, 0.65, 0.74, 0.95, 0.67, 0.67)) df$Time <- as.factor(df$Time) levels(df$Time) = c(1, 4, 24) df$Conc <- as.factor(df$Conc) levels(df$Conc) = c(1, 2, 5) library(ggplot2) ggplot(df, aes(x=Time, y=Value, colour=Conc)) + geom_point(size=6) + geom_line(aes(x=Time, y=Value, colour=Conc)) + scale_colour_manual(values = c("darkslategray3", "darkslategray4", "deepskyblue4")) + ggtitle("Working example") + xlab(expression(bold("Time (h)"))) + ylab(expression(bold("Concentration (mM)"))) ``` -- Best regards, Luigi ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.