現在我的數據幀像下面創建日期數據的新變量
dput(頭(t.zoo))
structure(c(85.92, 85.85, 85.83, 85.83, 85.85, 85.87, 1300, 1300,
1299.75, 1299.75, 1299.75, 1300), .Dim = c(6L, 2L), .Dimnames = list(
NULL, c("cl", "es")), index = structure(list(sec = c(0.400000095367432,
0.900000095367432, 1.40000009536743, 1.90000009536743, 2.40000009536743,
2.90000009536743), min = c(30L, 30L, 30L, 30L, 30L, 30L), hour = c(10L,
10L, 10L, 10L, 10L, 10L), mday = c(6L, 6L, 6L, 6L, 6L, 6L), mon = c(5L,
5L, 5L, 5L, 5L, 5L), year = c(112L, 112L, 112L, 112L, 112L, 112L
), wday = c(3L, 3L, 3L, 3L, 3L, 3L), yday = c(157L, 157L, 157L,
157L, 157L, 157L), isdst = c(1L, 1L, 1L, 1L, 1L, 1L)), .Names = c("sec",
"min", "hour", "mday", "mon", "year", "wday", "yday", "isdst"
), class = c("POSIXlt", "POSIXt"), tzone = c("", "EST", "EDT"
)), class = "zoo")
我有兩個問題,第一個是我想爲第一列添加一個變量名稱,第二是我想創建一個分類變量來幫助我指示2010-06-06(因爲有3個獨立的日子)
我應該爲日期數據做什麼?
請使用'dput'來創建您的數據樣本。並閱讀此:http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – 2012-07-13 14:36:43
「第一列」看起來像rownames或xts /動物園對象的索引。你真的需要提供來自'dput'的輸出,任何人都可以做更多的解決方案。 – 2012-07-13 15:02:19
感謝您的評論!我會投入並嘗試使其工作 – user1489975 2012-07-13 15:47:24