1
출생과 날짜는 같은 파일에서 같으며 같은 길이입니다. 날짜 형식이 좋을 것 같습니다. 그러나 xts
은 이것을 날짜로 인식 할 수 없습니다. 왜?! 당신의 도움을 주셔서 감사합니다!R에서 "xts"가 내 날짜 계열을 인식하지 못하는 이유는 무엇입니까?
dates <- read.xlsx("TimeSeriesCourseworkData.xls", 1,colIndex=1,as.data.frame=TRUE)
dates
Month
1 2009-01-01
2 2009-02-01
3 2009-03-01
4 2009-04-01
............
26 2011-02-01
27 2011-03-01
28 2011-04-01
29 2011-05-01
30 2011-06-01
births <- xts(births, order.by = dates)
# Error in xts(births, order.by = dates) :
# order.by requires an appropriate time-based object
births <- xts(births, order.by = as.Date(dates))
# Error in as.Date.default(dates) :
# do not know how to convert 'dates' to class “Date”
- XTS (출생) 그것은 작동합니까 – Thierry