我有一个动物园对象(tmp),它有日期和时间作为索引和如下值
> library(zoo)
> library(chron)
> tmp
(01/01/97 00:00:00) (01/01/97 01:00:00) (01/01/97 02:00:00)
5.0 3.2 6.7
> dput(tmp)
structure(c(5, 3.2, 6.7), index = structure(c(9862, 9862.04166666667,
9862.08333333333), format = structure(c("m/d/y", "h:m:s"), .Names = c("dates",
"times")), origin = structure(c(1, 1, 1970), .Names = c("month",
"day", "year")), class = c("chron", "dates", "times")), class = "zoo")
我正在尝试将此动物园对象写入文本文件,我只想将值写入文本文件中。我使用了以下代码:
write.zoo(tmp,file="D:/test.txt", row.names=FALSE, quote=FALSE, na="")
我得到以下文件:
(01/01/97 00:00:00) 5
(01/01/97 01:00:00) 3.2
(01/01/97 02:00:00) 6.7
但我想要的输出是
5
3.2
6.7
谁能告诉我如何得到这个?