그리고 이런 그래프도 가능해요.
library("lubridate")
library("ggplot2")
ggplot(a_series_df)+
geom_rect(data = data.frame(xmin = decimal_date(as.Date(c("1924-01-01"))),
xmax = decimal_date(as.Date(c("1928-12-31"))),
ymin = -Inf,
ymax = Inf),
aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
fill = "grey", alpha = 0.5) +
geom_line(data = a_series_df,aes(month, big), colour = "blue")+
ggtitle("Title of the plot using ggtitle()")
library("lubridate")
library("ggplot2")
ggplot() +
geom_rect(data = data.frame(xmin = decimal_date(as.Date(c("1924-01-01"))),
xmax = decimal_date(as.Date(c("1928-12-31"))),
ymin = -Inf,
ymax = Inf),
aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
fill = "red", alpha = 0.5) +
geom_line(data = a_series_df,aes(month, big), colour = "blue") +
theme_dark()+
ggtitle("Title of the plot using ggtitle()")
어떤 code가 변경되면서 그래프가 바뀌었을까요?
참고로 저는 이전에 "a_series_df"라는 것을 사용한 적이 있어서 별로도 이 data.frame을 load한 적이 없는데도 자동으로 데이타가 불러지는데 만일 그렇지 못하면 다음자료를 불러오세요. 만일 D폴더에 저장을 했다면...
a_series_df<-read.csv("D:\\a_series_df.csv")