R 将()类xts复制到列表中
我有一个xts对象R 将()类xts复制到列表中,r,list,xts,replicate,R,List,Xts,Replicate,我有一个xts对象frame frame <- structure(c("a", "a", "a"), .Dim = c(3L, 1L), index = structure(c(946702800, 946749600, 946796400), tzone = "", tclass = c("POSIXct", "POSIXt" )), class = c("xts", "zoo"), .indexCLASS = c("POSIXct", "POSIXt" ), tclass = c(
frame
frame <- structure(c("a", "a", "a"), .Dim = c(3L, 1L), index = structure(c(946702800,
946749600, 946796400), tzone = "", tclass = c("POSIXct", "POSIXt"
)), class = c("xts", "zoo"), .indexCLASS = c("POSIXct", "POSIXt"
), tclass = c("POSIXct", "POSIXt"), .indexTZ = "", tzone = "")
> frame
[,1]
2000-01-01 05:00:00 "a"
2000-01-01 18:00:00 "a"
2000-01-02 07:00:00 "a"
在调用
replicate
时设置simplify=FALSE
:
> replicate(5, frame, simplify=FALSE)
[[1]]
[,1]
2000-01-01 05:00:00 "a"
2000-01-01 18:00:00 "a"
2000-01-02 07:00:00 "a"
> replicate(5, frame, simplify=FALSE)
[[1]]
[,1]
2000-01-01 05:00:00 "a"
2000-01-01 18:00:00 "a"
2000-01-02 07:00:00 "a"