생년월일과 날짜가 같은 파일에서 나왔고 같은 길이를 공유합니다. 날짜 형식이 좋은 것 같습니다. 하지만 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”
dates
1 열 data.frame입니다. as.Date
xts의 order.by
인수에는 벡터가 필요합니다.
births <- xts(births, dates$Month)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다