Мне нужен график, включающий три линии, и одна из них имеет разные оси Y.Интересно, почему синяя линия здесь такая короткая?Это мой код:
library(plotrix)
a <- c(41.995 ,41.749, 41.484, 41.200 ,40.898, 40.587, 40.274 ,39.968, 39.672, 39.388, 39.108 ,38.822,
38.521 ,38.202, 37.866, 37.528, 37.205, 36.909 ,36.643 ,36.401, 36.167 ,35.918, 35.631 ,35.289,
34.886 ,34.418, 33.890, 33.320, 32.726, 32.121, 31.517 ,30.924, 30.348, 29.792, 29.258, 28.749,
28.262, 27.789 ,27.324, 26.861, 26.401, 25.944 ,25.489, 25.034 ,24.571 ,24.087 ,23.564 ,22.996,
22.390 ,21.755 ,21.114 ,20.495 ,19.923 ,19.416 ,18.984 ,18.625 ,18.332 ,18.083)
b<-c(1960:2017)
c<-c(22.184, 21.652, 21.126, 20.608, 20.096, 19.591 ,19.093, 18.603, 18.122, 17.650, 17.187 ,16.730,
16.280, 15.838, 15.408 ,14.994, 14.601, 14.233 ,13.892, 13.577, 13.290, 13.027 ,12.786 ,12.558,
12.337, 12.117, 11.888 ,11.649, 11.398, 11.135 ,10.864, 10.588, 10.316 ,10.055, 9.808, 9.579,
9.370 ,9.179 , 9.003 ,8.841, 8.692 , 8.555 ,8.427 , 8.306 , 8.189 , 8.074 ,7.958 , 7.839,
7.720 ,7.602 , 7.492 ,7.393 , 7.312 , 7.251 ,7.212 ,7.194 ,7.195 , 7.210)
d<-c(5.906, 5.902, 5.894, 5.880 ,5.859, 5.830 ,5.794, 5.751 ,5.702, 5.648 ,5.587, 5.519 ,5.444, 5.363,
5.278 ,5.192, 5.108, 5.029 ,4.956, 4.889 ,4.827 ,4.766 ,4.703, 4.636 ,4.563 ,4.484, 4.399 ,4.311,
4.222 ,4.132, 4.045, 3.959 ,3.877 ,3.799 ,3.723 ,3.651 ,3.582 ,3.514 ,3.446, 3.379 ,3.311 ,3.244,
3.176 ,3.109, 3.041, 2.972, 2.899 ,2.823, 2.743 ,2.661, 2.581 ,2.506, 2.439 ,2.381, 2.333 ,2.295,
2.266 ,2.243 )
df1<- data.frame(Year=b,CBR=a,CDR=c,TFR=d)
twoord.plot(lx=df1$Year,ly=df1$CBR,rx=df1$Year,ry=df1$TFR,type = "l",xaxs='i',xticklab =c(1960:2019,by=3),xtickpos =c(1960:2019,by=3),xlab = "Year", ylab = "Number",main = 'R')
grid()
lines(b,c ,type = "l", col = "blue")