我有这个数据框和这个图:
df <- data.frame(Groupe = rep(c("A","B"),4),
Period = gl(4,2,8,c("t0","t1","t2","t3","t4")),
rate = c(0.83,0.96,0.75,0.93,0.67,0.82,0.65,0.73))
ggplot(data = df, mapping = aes(y = rate, x = Period ,group = Groupe, colour=Groupe, shape=Groupe)) +
geom_line(size=1.2) +
geom_point(size=5)
我如何组织我的数据,以便之间的点t1
and t2
没有用线连接吗?我想要t0
and t1
要连接(根据组为蓝色或红色),t2
and t3
以同样的方式连接,但之间没有线t1
and t2
。我通过查看类似的问题尝试了几件事,但它总是弄乱我的分组颜色:/