2003-01-01 -0.6264538 1.51178117
2003-01-03 0.1836433 0.38984324
2003-01-05 -0.8356286 -0.62124058
2003-01-07 1.5952808 -2.21469989
2003-02-09 0.3295078 1.12493092
2003-02-11 -0.8204684 -0.04493361
2003-02-13 0.4874291 -0.01619026
2003-03-15 0.7383247 0.94383621
2003-03-17 0.5757814 0.82122120
2003-04-19 -0.3053884 0.59390132
2003-02-09 0.3295078 1.12493092
2003-02-11 -0.8204684 -0.04493361
2003-02-13 0.4874291 -0.01619026
2003-02-09 0.3295078 1.12493092
2003-02-11 -0.8204684 -0.04493361
2003-01-07 1.5952808 -2.2146999
2003-03-15 0.7383247 0.9438362
2003-04-19 -0.3053884 0.5939013
2003-01-01 -0.6264538 1.51178117
2003-01-03 0.1836433 0.38984324
2003-01-05 -0.8356286 -0.62124058
2003-01-07 1.0000000 4.00000000
2003-02-09 0.3295078 1.12493092
2003-02-11 -0.8204684 -0.04493361
2003-02-13 0.4874291 -0.01619026
2003-03-15 2.0000000 5.00000000
2003-03-17 0.5757814 0.82122120
2003-04-19 3.0000000 6.00000000
## for classes that support comparisons with "character" variables
## start and end may be "character".
window(x, start = "2003-02-01")
2003-02-09 0.3295078 1.12493092
2003-02-11 -0.8204684 -0.04493361
2003-02-13 0.4874291 -0.01619026
2003-03-15 2.0000000 5.00000000
2003-03-17 0.5757814 0.82122120
2003-04-19 3.0000000 6.00000000
2001 Q4 2002 Q1 2002 Q2
-1.4707524 -0.4781501 0.4179416
2000 Q2 2000 Q4 2001 Q1 2001 Q2 2001 Q3 2001 Q4
0.78213630 -1.98935170 0.61982575 -0.05612874 -0.15579551 -1.47075238
2002 Q1 2002 Q2
-0.47815006 0.41794156
## replace data at times of d0 which are in dn
d1 <- d0 <- zoo(1:10) + 100
dn <- - head(d0, 4)
window(d1, time(dn)) <- coredata(dn)
## if the underlying time index is a float, note that the index may
## print in the same way but actually be different (e.g., differing
## by 0.1 second in this example)
zp <- zoo(1:4, as.POSIXct("2000-01-01 00:00:00") + c(-3600, 0, 0.1, 3600))
## and then the >= start and <= end may not select all intended
## observations and adding/subtracting some "fuzz" may be needed
window(zp, end = "2000-01-01 00:00:00")1999-12-31 23:00:00 2000-01-01 00:00:00
1 2
window(zp, end = as.POSIXct("2000-01-01 00:00:00") + 0.5)1999-12-31 23:00:00 2000-01-01 00:00:00 2000-01-01 00:00:00
1 2 3