xts와 plot() 함수 복습

R로 시계열 데이터 시각화하기

Arnaud Amsellem

Quantitative Trader and creator of the R Trader blog

xts 복습

  • 시계열을 다루는 특수 클래스
  • eXtensible Time Series
  • xts = 시간 인덱스 + 행렬
  • 인덱스는 시간 객체: Date, POSIX Time, timeDate, chron

ch1_vid1_slides.003.png

R로 시계열 데이터 시각화하기

plot()와 plot.xts()

  • plot()
  • plot.xts()
  • 그리려는 객체가 xts이면 plot()plot.xts() 대신 사용할 수 있음
R로 시계열 데이터 시각화하기

plot() 함수 사용하기

ch1_vid1_slides.010.png

plot(my_ts)
R로 시계열 데이터 시각화하기

plot() 함수 사용하기

ch1_vid1_slides.013.png

plot(my_ts, main = "my first time series")
lines(my_ts, col = "red", lwd = 2)
R로 시계열 데이터 시각화하기

plot() 함수 사용하기

ch1_vid1_slides.022.png

plot(my_ts, main = "my first time series", 
            sub = "from Sep. 2008 to Dec. 2016")
lines(my_ts, col = "red", lwd = 2)
R로 시계열 데이터 시각화하기

연습해 봅시다!

R로 시계열 데이터 시각화하기

Preparing Video For Download...