我对 R 很陌生,所以这个问题非常初级,但我自己无法解决。非常感谢您的帮助。
这是我想使用的一种数据框:
Period Value Cut.off
1 January 1998 - August 2002 8.798129 1.64
2 September 2002 - Jun 2006 4.267268 1.64
3 Jul 2006 - Dec 2009 7.280275 1.64
这是我正在使用的代码:
require(ggplot2)
bq <- ggplot(data=glomor, aes(x=as.character(Period),y=Value))+geom_point()+ylim(0,10)
bq <- bq + scale_x_discrete(limits=c("January 1998 - August 2002","September 2002 - Jun 2006","Jul 2006 - Dec 2009"))
bq + geom_line()
我收到以下错误消息:
geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic?
我如何需要更改代码,以便点将通过一条线连接?