我想將df轉換爲xts與年終日期日期索引(即1989-12-31)。我搜索了網頁,但沒有答案。感謝並感謝您的幫助。如何在xts中將數字年份月份轉換爲年份 - 月份 - 日期日期格式?
df <- read.table(textConnection("
date a b c d
198912 29.46 13.47 32.52 22.06
199001 36.35 17.30 38.14 24.98
199002 33.72 15.57 38.14 23.61
199003 30.76 14.01 34.74 21.73
"),header=T)