Skip to Content

error with simple ggplot2 line plot

I'm trying to make a simple line plot but I get the following error:

geom_path: Each group consist of only one observation. Do you need to
adjust the group aesthetic?

I want status.std on the y-axis, effort on the x-axis, with status_measure distinguishing the two separate lines.

Below is my data and the code I'm executing:

df.effort <- structure(list(effort = structure(c(1L, 2L, 3L, 4L, 1L, 2L, 3L, 
4L), .Label = c("never", "not very hard", "hard enough", "very hard"
), class = "factor"), status.std = structure(c(-0.0234448237301297, 
0.0568346993679614, 0.0780165665285588, -0.0380394621882508, 
-0.135535917573711, 0.0128879641418037, 0.0806307867881565, -0.0104818763687783
), .Names = c("never", "not very hard", "hard enough", "very hard", 
"never", "not very hard", "hard enough", "very hard")), status_measure = structure(c(1L, 
1L, 1L, 1L, 2L, 2L, 2L, 2L), .Label = c("avrank.zmgs", "acent09l.zmgs"
), class = "factor")), .Names = c("effort", "status.std", "status_measure"
), row.names = c(NA, 8L), class = "data.frame")
 
ggplot(data=df.effort,
       aes(x=effort), y=status.std, colour=status_measure)) +   geom_line()

Many thanks for any help. I regret that this question seems unlikely to be instructive to others. If there is a title edit or something that would make it more general that would be fantastic.