我现在有一组4*16的数据,我想用ggplot2画一个像图1那样的漂亮的刻面折线图,但是我的代码是这样的,通过一些信息我知道我认为我的数据排序有问题,但是我不知道怎么调整,请帮帮我.
data<-data.frame(A=c(0.05,0.10,0.05,0.10,0.05,0.10,0.05,0.10,0.05,0.10,0.05,0.10,0.05,0.10,0.05,0.10),
B=c(1,1,3,3,1,1,3,3,1,1,3,3,1,1,3,3),
C=c(1,1,1,1,5,5,5,5,6,6,6,6,10,10,10,10),
D=c(1.3221625,1.3006163,1.3091457,1.2738161,1.2470091,
1.1765646,1.1838100,1.0545490,1.2307647,1.1513869,
1.1569168,1.0097403,1.1758619,1.068641,1.0578440,
0.8668918))
ggplot(data,aes(x=factor(C),y=D, colour=B))+
geom_point(shape=1)+
facet_wrap(~A,ncol = 2, nrow = 2)+geom_line()
1条答案
按热度按时间bf1o4zei1#
你几乎是:
创建于2022年11月27日,使用reprex v2.0.2