1
R에 alphavantager
패키지를 사용하여 데이터를 다운로드했습니다. xts
시계열로 분 데이터를 설정하려고합니다. 내가 is.xts(df)
을 실행하면AlphaVantager 시계열 설정 YYYY MM DD HH MM SS
rm(list = ls())
library(alphavantager)
AlphaKey <- av_api_key("YOUR API Key (Free) - (obtainable here: https://www.alphavantage.co/support/#api-key) ")
print(AlphaKey)
args(av_get)
GOOG <- av_get(symbol = "GOOG", av_fun = "TIME_SERIES_INTRADAY", interval = "1min", outputsize = "full")
plot(GOOG$close)
close_price <- GOOG$close
times <- as.POSIXct(GOOG$timestamp, format="%d/%m/%Y %H:%M")
times
times <-format(GOOG$timestamp, format="%H:%M:%S")
df <- cbind(times, close_price)
, 내가 출력 FALSE
를 얻을. 다음 형식으로 xts 객체로 GOOG$timestamp
을 설정하려고 시도하므로 quantmod
패키지에서 chartSeries
을 실행할 수 있습니다.
head(GOOG$timestamp)
[1] "2017-10-30 09:30:00 UTC"
[2] "2017-10-30 09:31:00 UTC"
[3] "2017-10-30 09:32:00 UTC"
[4] "2017-10-30 09:33:00 UTC"
[5] "2017-10-30 09:34:00 UTC"
[6] "2017-10-30 09:35:00 UTC"
어떻게 R에서이 일에 대해 갈 수 있나요?
편집 : 나는 chartSeries
기능에서 얻을 오류 :
chartSeries(df, TA=NULL)
> Error in try.xts(x, error = "chartSeries requires an xtsible object") :
chartSeries requires an xtsible object