는 재현 예입니다날짜별로 xts 데이터를 xts 개체 목록에서 분리하고 목록을 만드는 방법은 무엇입니까? 여기에 내 질문에 명확히하기 위해
ibov <- structure(c(0.029210645, -0.000172395, 0.035483633, -0.011969176,-0.007692018, 0.010634809, 0.027410321, -0.002632171, 0.000878164,0.004689955), .indexCLASS = "Date", tclass = "Date", .indexTZ = "UTC", tzone = "UTC", .CLASS = "double", class = c("xts","zoo"), index = structure(c(1041465600, 1041552000, 1041811200,1041897600, 1041984000, 1042070400, 1042156800, 1388016000, 1388102400,1388361600), tzone = "UTC", tclass = "Date"), .Dim = c(10L, 1L), .Dimnames = list(NULL, "IBOV"))
resa <- structure(c(0.010810871, 0, 0.021277441, 0, -0.021277438, 0.010695311,0.010582131, 0.038614857, -0.022989515, 0.022989514, 0.009950331,-0.006253523, -0.011131809, -0.032230311, 0.019084526, 0.027960905,-0.027960898, 0.013885075, 0.006913914, 0.001716716), class = c("xts","zoo"), .indexCLASS = "Date", tclass = "Date", .indexTZ = "UTC", tzone = "UTC", index = structure(c(1041465600,1041552000, 1041811200, 1041897600, 1041984000, 1042070400, 1042156800,1051488000, 1051574400, 1051660800), tzone = "UTC", tclass = "Date"), .Dim = c(10L,2L), .Dimnames = list(NULL, c("ACES4", "AMBV4")))
resb <- structure(c(0.033371931, -0.066402455, 0.014815083, 0.018215437,0.01647012, -0.009275838, -0.013713674, 0, 0.020007567, 0.017603702,0.02777956, -0.001054296, -0.019169914, -0.005390845, 0.008611465,0.00641028, -0.004268949, -0.025679012, -0.08124767, 0.027822509), class = c("xts", "zoo"), .indexCLASS = "Date", tclass = "Date", .indexTZ = "UTC", tzone = "UTC", index = structure(c(1378080000,1378166400, 1378252800, 1378339200, 1378425600, 1378684800, 1378771200,1388016000, 1388102400, 1388361600), tzone = "UTC", tclass = "Date"), .Dim = c(10L,2L), .Dimnames = list(NULL, c("AEDU3", "ALLL3")))
lst <- list(resa, resb)
나도 같은
lst
날짜에 따라 분류
lst
같은 목록에
ibov
데이터를 분리 할 수 있습니다 어떻게
? 다음과 같이 반환해야합니다.
bova <- structure(c(0.029210645, -0.000172395, 0.035483633, -0.011969176,-0.007692018, 0.010634809, 0.027410321), .indexCLASS = "Date", tclass = "Date", .indexTZ = "UTC", tzone = "UTC", .CLASS = "double", class = c("xts","zoo"), index = structure(c(1041465600, 1041552000, 1041811200,1041897600, 1041984000, 1042070400, 1042156800), tzone = "UTC", tclass = "Date"), .Dim = c(7L, 1L), .Dimnames = list(NULL, "IBOV"))
bovb <- structure(c(-0.002632171, 0.000878164,0.004689955), .indexCLASS = "Date", tclass = "Date", .indexTZ = "UTC", tzone = "UTC", .CLASS = "double", class = c("xts","zoo"), index = structure(c(1388016000, 1388102400,1388361600), tzone = "UTC", tclass = "Date"), .Dim = c(3L, 1L), .Dimnames = list(NULL, "IBOV"))
newlst <- list(bova, bovb)
> newlst
[[1]]
IBOV
2003-01-02 0.029210645
2003-01-03 -0.000172395
2003-01-06 0.035483633
2003-01-07 -0.011969176
2003-01-08 -0.007692018
2003-01-09 0.010634809
2003-01-10 0.027410321
[[2]]
IBOV
2013-12-26 -0.002632171
2013-12-27 0.000878164
2013-12-30 0.004689955
도움이 될 것입니다. 감사! 나중에 참조하려면
아마도 '? split.xts'. –
@JoshuaUlrich 감사합니다. 'lst'와'ibov'의 실제 데이터는 같은 기간을 가지므로 도움이되었습니다. –
제 말은 분기 별 데이터 목록이 필요할 때 도움이되었습니다. –