Take a Date
, POSIXct
, or POSIXlt
vector and subset it by
a pattern of date and/or time parts.
subset_span(spanned, pattern_list)
spanned | A vector of class |
---|---|
pattern_list | A list with the desired pattern for each of the following datetime parts: year, mon, mday, wday, hour, min, sec. |
Vector of the same class as spanned
, containing all the data points in
spanned
that meets the requirements in pattern_list
.
For subsetting weekdays, they run from 0 (Sunday) to 6 (Saturday).
#> [1] "2017-07-03" "2017-07-04" "2017-07-05" "2017-07-06" "2017-07-07" #> [6] "2017-07-10" "2017-07-11" "2017-07-12" "2017-07-13" "2017-07-14" #> [11] "2017-07-17" "2017-07-18" "2017-07-19" "2017-07-20" "2017-07-21" #> [16] "2017-07-24" "2017-07-25" "2017-07-26" "2017-07-27" "2017-07-28" #> [21] "2017-07-31" "2017-08-01" "2017-08-02" "2017-08-03" "2017-08-04" #> [26] "2017-08-07" "2017-08-08" "2017-08-09" "2017-08-10" "2017-08-11" #> [31] "2017-08-14" "2017-08-15" "2017-08-16" "2017-08-17" "2017-08-18" #> [36] "2017-08-21" "2017-08-22" "2017-08-23" "2017-08-24" "2017-08-25" #> [41] "2017-08-28" "2017-08-29" "2017-08-30" "2017-08-31" "2017-09-01" #> [46] "2017-09-04" "2017-09-05" "2017-09-06" "2017-09-07" "2017-09-08" #> [51] "2017-09-11" "2017-09-12" "2017-09-13" "2017-09-14" "2017-09-15" #> [56] "2017-09-18" "2017-09-19" "2017-09-20" "2017-09-21" "2017-09-22" #> [61] "2017-09-25" "2017-09-26" "2017-09-27" "2017-09-28" "2017-09-29" #> [66] "2017-10-02" "2017-10-03" "2017-10-04" "2017-10-05" "2017-10-06"#> [1] "2017-01-01 07:00:00 UTC" "2017-01-01 08:00:00 UTC" #> [3] "2017-01-01 09:00:00 UTC" "2017-01-01 10:00:00 UTC" #> [5] "2017-01-01 11:00:00 UTC" "2017-01-01 12:00:00 UTC" #> [7] "2017-01-01 13:00:00 UTC" "2017-01-01 14:00:00 UTC" #> [9] "2017-01-01 15:00:00 UTC" "2017-01-01 16:00:00 UTC" #> [11] "2017-01-01 17:00:00 UTC" "2017-01-02 07:00:00 UTC" #> [13] "2017-01-02 08:00:00 UTC" "2017-01-02 09:00:00 UTC" #> [15] "2017-01-02 10:00:00 UTC" "2017-01-02 11:00:00 UTC" #> [17] "2017-01-02 12:00:00 UTC" "2017-01-02 13:00:00 UTC" #> [19] "2017-01-02 14:00:00 UTC" "2017-01-02 15:00:00 UTC" #> [21] "2017-01-02 16:00:00 UTC" "2017-01-02 17:00:00 UTC" #> [23] "2017-01-03 07:00:00 UTC" "2017-01-03 08:00:00 UTC" #> [25] "2017-01-03 09:00:00 UTC" "2017-01-03 10:00:00 UTC" #> [27] "2017-01-03 11:00:00 UTC" "2017-01-03 12:00:00 UTC" #> [29] "2017-01-03 13:00:00 UTC" "2017-01-03 14:00:00 UTC" #> [31] "2017-01-03 15:00:00 UTC" "2017-01-03 16:00:00 UTC" #> [33] "2017-01-03 17:00:00 UTC" "2017-01-04 07:00:00 UTC" #> [35] "2017-01-04 08:00:00 UTC" "2017-01-04 09:00:00 UTC" #> [37] "2017-01-04 10:00:00 UTC" "2017-01-04 11:00:00 UTC" #> [39] "2017-01-04 12:00:00 UTC" "2017-01-04 13:00:00 UTC" #> [41] "2017-01-04 14:00:00 UTC" "2017-01-04 15:00:00 UTC" #> [43] "2017-01-04 16:00:00 UTC" "2017-01-04 17:00:00 UTC" #> [45] "2017-01-05 07:00:00 UTC" "2017-01-05 08:00:00 UTC" #> [47] "2017-01-05 09:00:00 UTC" "2017-01-05 10:00:00 UTC" #> [49] "2017-01-05 11:00:00 UTC" "2017-01-05 12:00:00 UTC" #> [51] "2017-01-05 13:00:00 UTC" "2017-01-05 14:00:00 UTC" #> [53] "2017-01-05 15:00:00 UTC" "2017-01-05 16:00:00 UTC" #> [55] "2017-01-05 17:00:00 UTC" "2017-01-06 07:00:00 UTC" #> [57] "2017-01-06 08:00:00 UTC" "2017-01-06 09:00:00 UTC" #> [59] "2017-01-06 10:00:00 UTC" "2017-01-06 11:00:00 UTC" #> [61] "2017-01-06 12:00:00 UTC" "2017-01-06 13:00:00 UTC" #> [63] "2017-01-06 14:00:00 UTC" "2017-01-06 15:00:00 UTC" #> [65] "2017-01-06 16:00:00 UTC" "2017-01-06 17:00:00 UTC" #> [67] "2017-01-07 07:00:00 UTC" "2017-01-07 08:00:00 UTC" #> [69] "2017-01-07 09:00:00 UTC" "2017-01-07 10:00:00 UTC" #> [71] "2017-01-07 11:00:00 UTC" "2017-01-07 12:00:00 UTC" #> [73] "2017-01-07 13:00:00 UTC" "2017-01-07 14:00:00 UTC" #> [75] "2017-01-07 15:00:00 UTC" "2017-01-07 16:00:00 UTC" #> [77] "2017-01-07 17:00:00 UTC" "2017-01-08 07:00:00 UTC" #> [79] "2017-01-08 08:00:00 UTC" "2017-01-08 09:00:00 UTC" #> [81] "2017-01-08 10:00:00 UTC" "2017-01-08 11:00:00 UTC" #> [83] "2017-01-08 12:00:00 UTC" "2017-01-08 13:00:00 UTC" #> [85] "2017-01-08 14:00:00 UTC" "2017-01-08 15:00:00 UTC" #> [87] "2017-01-08 16:00:00 UTC" "2017-01-08 17:00:00 UTC" #> [89] "2017-01-09 07:00:00 UTC" "2017-01-09 08:00:00 UTC" #> [91] "2017-01-09 09:00:00 UTC" "2017-01-09 10:00:00 UTC" #> [93] "2017-01-09 11:00:00 UTC" "2017-01-09 12:00:00 UTC" #> [95] "2017-01-09 13:00:00 UTC" "2017-01-09 14:00:00 UTC" #> [97] "2017-01-09 15:00:00 UTC" "2017-01-09 16:00:00 UTC" #> [99] "2017-01-09 17:00:00 UTC" "2017-01-10 07:00:00 UTC" #> [101] "2017-01-10 08:00:00 UTC" "2017-01-10 09:00:00 UTC" #> [103] "2017-01-10 10:00:00 UTC" "2017-01-10 11:00:00 UTC" #> [105] "2017-01-10 12:00:00 UTC" "2017-01-10 13:00:00 UTC" #> [107] "2017-01-10 14:00:00 UTC" "2017-01-10 15:00:00 UTC" #> [109] "2017-01-10 16:00:00 UTC" "2017-01-10 17:00:00 UTC" #> [111] "2017-01-11 07:00:00 UTC" "2017-01-11 08:00:00 UTC" #> [113] "2017-01-11 09:00:00 UTC" "2017-01-11 10:00:00 UTC" #> [115] "2017-01-11 11:00:00 UTC" "2017-01-11 12:00:00 UTC" #> [117] "2017-01-11 13:00:00 UTC" "2017-01-11 14:00:00 UTC" #> [119] "2017-01-11 15:00:00 UTC" "2017-01-11 16:00:00 UTC" #> [121] "2017-01-11 17:00:00 UTC" "2017-01-12 07:00:00 UTC" #> [123] "2017-01-12 08:00:00 UTC" "2017-01-12 09:00:00 UTC" #> [125] "2017-01-12 10:00:00 UTC" "2017-01-12 11:00:00 UTC" #> [127] "2017-01-12 12:00:00 UTC" "2017-01-12 13:00:00 UTC" #> [129] "2017-01-12 14:00:00 UTC" "2017-01-12 15:00:00 UTC" #> [131] "2017-01-12 16:00:00 UTC" "2017-01-12 17:00:00 UTC" #> [133] "2017-01-13 07:00:00 UTC" "2017-01-13 08:00:00 UTC" #> [135] "2017-01-13 09:00:00 UTC" "2017-01-13 10:00:00 UTC" #> [137] "2017-01-13 11:00:00 UTC" "2017-01-13 12:00:00 UTC" #> [139] "2017-01-13 13:00:00 UTC" "2017-01-13 14:00:00 UTC" #> [141] "2017-01-13 15:00:00 UTC" "2017-01-13 16:00:00 UTC" #> [143] "2017-01-13 17:00:00 UTC" "2017-01-14 07:00:00 UTC" #> [145] "2017-01-14 08:00:00 UTC" "2017-01-14 09:00:00 UTC" #> [147] "2017-01-14 10:00:00 UTC" "2017-01-14 11:00:00 UTC" #> [149] "2017-01-14 12:00:00 UTC" "2017-01-14 13:00:00 UTC" #> [151] "2017-01-14 14:00:00 UTC" "2017-01-14 15:00:00 UTC" #> [153] "2017-01-14 16:00:00 UTC" "2017-01-14 17:00:00 UTC" #> [155] "2017-01-15 07:00:00 UTC" "2017-01-15 08:00:00 UTC" #> [157] "2017-01-15 09:00:00 UTC" "2017-01-15 10:00:00 UTC" #> [159] "2017-01-15 11:00:00 UTC" "2017-01-15 12:00:00 UTC" #> [161] "2017-01-15 13:00:00 UTC" "2017-01-15 14:00:00 UTC" #> [163] "2017-01-15 15:00:00 UTC" "2017-01-15 16:00:00 UTC" #> [165] "2017-01-15 17:00:00 UTC" "2017-01-16 07:00:00 UTC" #> [167] "2017-01-16 08:00:00 UTC" "2017-01-16 09:00:00 UTC" #> [169] "2017-01-16 10:00:00 UTC" "2017-01-16 11:00:00 UTC" #> [171] "2017-01-16 12:00:00 UTC" "2017-01-16 13:00:00 UTC" #> [173] "2017-01-16 14:00:00 UTC" "2017-01-16 15:00:00 UTC" #> [175] "2017-01-16 16:00:00 UTC" "2017-01-16 17:00:00 UTC" #> [177] "2017-01-17 07:00:00 UTC" "2017-01-17 08:00:00 UTC" #> [179] "2017-01-17 09:00:00 UTC" "2017-01-17 10:00:00 UTC" #> [181] "2017-01-17 11:00:00 UTC" "2017-01-17 12:00:00 UTC" #> [183] "2017-01-17 13:00:00 UTC" "2017-01-17 14:00:00 UTC" #> [185] "2017-01-17 15:00:00 UTC" "2017-01-17 16:00:00 UTC" #> [187] "2017-01-17 17:00:00 UTC" "2017-01-18 07:00:00 UTC" #> [189] "2017-01-18 08:00:00 UTC" "2017-01-18 09:00:00 UTC" #> [191] "2017-01-18 10:00:00 UTC" "2017-01-18 11:00:00 UTC" #> [193] "2017-01-18 12:00:00 UTC" "2017-01-18 13:00:00 UTC" #> [195] "2017-01-18 14:00:00 UTC" "2017-01-18 15:00:00 UTC" #> [197] "2017-01-18 16:00:00 UTC" "2017-01-18 17:00:00 UTC" #> [199] "2017-01-19 07:00:00 UTC" "2017-01-19 08:00:00 UTC" #> [201] "2017-01-19 09:00:00 UTC" "2017-01-19 10:00:00 UTC" #> [203] "2017-01-19 11:00:00 UTC" "2017-01-19 12:00:00 UTC" #> [205] "2017-01-19 13:00:00 UTC" "2017-01-19 14:00:00 UTC" #> [207] "2017-01-19 15:00:00 UTC" "2017-01-19 16:00:00 UTC" #> [209] "2017-01-19 17:00:00 UTC" "2017-01-20 07:00:00 UTC" #> [211] "2017-01-20 08:00:00 UTC" "2017-01-20 09:00:00 UTC" #> [213] "2017-01-20 10:00:00 UTC" "2017-01-20 11:00:00 UTC" #> [215] "2017-01-20 12:00:00 UTC" "2017-01-20 13:00:00 UTC" #> [217] "2017-01-20 14:00:00 UTC" "2017-01-20 15:00:00 UTC" #> [219] "2017-01-20 16:00:00 UTC" "2017-01-20 17:00:00 UTC" #> [221] "2017-01-21 07:00:00 UTC" "2017-01-21 08:00:00 UTC" #> [223] "2017-01-21 09:00:00 UTC" "2017-01-21 10:00:00 UTC" #> [225] "2017-01-21 11:00:00 UTC" "2017-01-21 12:00:00 UTC" #> [227] "2017-01-21 13:00:00 UTC" "2017-01-21 14:00:00 UTC" #> [229] "2017-01-21 15:00:00 UTC" "2017-01-21 16:00:00 UTC" #> [231] "2017-01-21 17:00:00 UTC" "2017-01-22 07:00:00 UTC" #> [233] "2017-01-22 08:00:00 UTC" "2017-01-22 09:00:00 UTC" #> [235] "2017-01-22 10:00:00 UTC" "2017-01-22 11:00:00 UTC" #> [237] "2017-01-22 12:00:00 UTC" "2017-01-22 13:00:00 UTC" #> [239] "2017-01-22 14:00:00 UTC" "2017-01-22 15:00:00 UTC" #> [241] "2017-01-22 16:00:00 UTC" "2017-01-22 17:00:00 UTC" #> [243] "2017-01-23 07:00:00 UTC" "2017-01-23 08:00:00 UTC" #> [245] "2017-01-23 09:00:00 UTC" "2017-01-23 10:00:00 UTC" #> [247] "2017-01-23 11:00:00 UTC" "2017-01-23 12:00:00 UTC" #> [249] "2017-01-23 13:00:00 UTC" "2017-01-23 14:00:00 UTC" #> [251] "2017-01-23 15:00:00 UTC" "2017-01-23 16:00:00 UTC" #> [253] "2017-01-23 17:00:00 UTC" "2017-01-24 07:00:00 UTC" #> [255] "2017-01-24 08:00:00 UTC" "2017-01-24 09:00:00 UTC" #> [257] "2017-01-24 10:00:00 UTC" "2017-01-24 11:00:00 UTC" #> [259] "2017-01-24 12:00:00 UTC" "2017-01-24 13:00:00 UTC" #> [261] "2017-01-24 14:00:00 UTC" "2017-01-24 15:00:00 UTC" #> [263] "2017-01-24 16:00:00 UTC" "2017-01-24 17:00:00 UTC" #> [265] "2017-01-25 07:00:00 UTC" "2017-01-25 08:00:00 UTC" #> [267] "2017-01-25 09:00:00 UTC" "2017-01-25 10:00:00 UTC" #> [269] "2017-01-25 11:00:00 UTC" "2017-01-25 12:00:00 UTC" #> [271] "2017-01-25 13:00:00 UTC" "2017-01-25 14:00:00 UTC" #> [273] "2017-01-25 15:00:00 UTC" "2017-01-25 16:00:00 UTC" #> [275] "2017-01-25 17:00:00 UTC" "2017-01-26 07:00:00 UTC" #> [277] "2017-01-26 08:00:00 UTC" "2017-01-26 09:00:00 UTC" #> [279] "2017-01-26 10:00:00 UTC" "2017-01-26 11:00:00 UTC" #> [281] "2017-01-26 12:00:00 UTC" "2017-01-26 13:00:00 UTC" #> [283] "2017-01-26 14:00:00 UTC" "2017-01-26 15:00:00 UTC" #> [285] "2017-01-26 16:00:00 UTC" "2017-01-26 17:00:00 UTC" #> [287] "2017-01-27 07:00:00 UTC" "2017-01-27 08:00:00 UTC" #> [289] "2017-01-27 09:00:00 UTC" "2017-01-27 10:00:00 UTC" #> [291] "2017-01-27 11:00:00 UTC" "2017-01-27 12:00:00 UTC" #> [293] "2017-01-27 13:00:00 UTC" "2017-01-27 14:00:00 UTC" #> [295] "2017-01-27 15:00:00 UTC" "2017-01-27 16:00:00 UTC" #> [297] "2017-01-27 17:00:00 UTC" "2017-01-28 07:00:00 UTC" #> [299] "2017-01-28 08:00:00 UTC" "2017-01-28 09:00:00 UTC" #> [301] "2017-01-28 10:00:00 UTC" "2017-01-28 11:00:00 UTC" #> [303] "2017-01-28 12:00:00 UTC" "2017-01-28 13:00:00 UTC" #> [305] "2017-01-28 14:00:00 UTC" "2017-01-28 15:00:00 UTC" #> [307] "2017-01-28 16:00:00 UTC" "2017-01-28 17:00:00 UTC" #> [309] "2017-01-29 07:00:00 UTC" "2017-01-29 08:00:00 UTC" #> [311] "2017-01-29 09:00:00 UTC" "2017-01-29 10:00:00 UTC" #> [313] "2017-01-29 11:00:00 UTC" "2017-01-29 12:00:00 UTC" #> [315] "2017-01-29 13:00:00 UTC" "2017-01-29 14:00:00 UTC" #> [317] "2017-01-29 15:00:00 UTC" "2017-01-29 16:00:00 UTC" #> [319] "2017-01-29 17:00:00 UTC" "2017-01-30 07:00:00 UTC" #> [321] "2017-01-30 08:00:00 UTC" "2017-01-30 09:00:00 UTC" #> [323] "2017-01-30 10:00:00 UTC" "2017-01-30 11:00:00 UTC" #> [325] "2017-01-30 12:00:00 UTC" "2017-01-30 13:00:00 UTC" #> [327] "2017-01-30 14:00:00 UTC" "2017-01-30 15:00:00 UTC" #> [329] "2017-01-30 16:00:00 UTC" "2017-01-30 17:00:00 UTC" #> [331] "2017-01-31 07:00:00 UTC" "2017-01-31 08:00:00 UTC" #> [333] "2017-01-31 09:00:00 UTC" "2017-01-31 10:00:00 UTC" #> [335] "2017-01-31 11:00:00 UTC" "2017-01-31 12:00:00 UTC" #> [337] "2017-01-31 13:00:00 UTC" "2017-01-31 14:00:00 UTC" #> [339] "2017-01-31 15:00:00 UTC" "2017-01-31 16:00:00 UTC" #> [341] "2017-01-31 17:00:00 UTC"#> [1] "2017-01-05 10:00:00 UTC" "2017-01-05 16:00:00 UTC" #> [3] "2017-01-10 10:00:00 UTC" "2017-01-10 16:00:00 UTC" #> [5] "2017-01-15 10:00:00 UTC" "2017-01-15 16:00:00 UTC" #> [7] "2017-01-20 10:00:00 UTC" "2017-01-20 16:00:00 UTC" #> [9] "2017-01-25 10:00:00 UTC" "2017-01-25 16:00:00 UTC" #> [11] "2017-01-30 10:00:00 UTC" "2017-01-30 16:00:00 UTC"