我正在尝试制作一个简单的线图,但出现以下错误:
geom_path:每个组仅包含一个观察值。需要调整群体审美吗?
我想要 y 轴上的 status.std,x 轴上的努力,status_measure 区分两条单独的线。
下面是我的数据和我正在执行的代码:
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()
非常感谢您的帮助。我很遗憾这个问题似乎不太可能对其他人有指导意义。如果有标题编辑或使其更通用的东西,那就太棒了。