Dear All,
I have plotted a time series graph with two vertical lines. I am trying to shade in between the vertical lines (between 1982 and 2008 )
I would appreciate your help. My code and graph are below
Infl<- ts(data$Infl, start= c(1966,1,1), frequency = 4)
plot(Infl)
abline(v=c(1982,2008),col = "red")
data <- structure(list(Infl = c(3.3, 3.9, 3.4, 1.7, 2.1, 3.9, 4.5, 4.5,
4.3, 4, 5.8, 4.2, 5.2, 5.7, 5.3, 5.8, 5.7, 3.3, 5.4, 6.2, 5.4,
4.1, 3.4, 6.2, 2.5, 3.9, 5.2, 4.7, 6.3, 8, 8.2, 7.8, 9.8, 12.3,
12.3, 9.4, 6.1, 7.3, 6.9, 4.3, 4.1, 5.3, 7.4, 6.6, 5.8, 5, 8.9,
5.9, 7.9, 7, 8.5, 7.5, 10.2, 9, 7.6, 8.7, 9.9, 9.2, 10.8, 11,
8.2, 7.7, 7.1, 5.6, 5.3, 5.8, 4.2, 3.1, 3, 4.3, 3.1, 4.1, 3.5,
3.6, 3, 4, 2.6, 2.4, 2.3, 2, 1.5, 1.6, 2.2, 2.6, 2.8, 3.1, 3.2,
3.2, 4, 4.9, 3.5, 4.2, 4.3, 3, 2.9, 4.4, 4.6, 3.5, 3, 4, 3, 3.2,
2.4, 1.5, 2.4, 2, 2.8, 2.3, 2.4, 2.4, 2.2, 1.9, 1.9, 2.3, 2.2,
2.2, 1.9, 2, 1.9, 1.9, 1.7, 1.3, 2.2, 2.4, 0.8, 1.7, 1.3, 0.6,
0.9, 1.7, 1.1, 1.5, 1.5, 1.4, 2.2, 2.7, 2.4, 2.3, 2.1, 2.5, 2.4,
1.6, 1.3, 1.3, 1.4, 1.9, 2.3, 1.8, 1.2, 2.2, 2.4, 3, 3.3, 2.6,
3.1, 3.2, 2.8, 3.7, 3.3, 2.8, 3.4, 2.8, 1.5, 4, 2.6, 2.1, 1.6,
1.5, 2.2, 3, 1.3, 0, -0.6, 0.4, 1.4, 1, 1.9, 1.2, 2.3, 2.2, 2.7,
2.6, 0.6, 2.5, 1.6, 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