Return data subset time frames within another timeframes?

前端 未结 3 579
隐瞒了意图╮
隐瞒了意图╮ 2020-11-29 17:01

There are very nifty ways of subsetting xts objects. For example, one can get all the data for all years, months, days but being strictly between 9:30 AM and 4

3条回答
  •  旧巷少年郎
    2020-11-29 17:27

    time-of-day subsetting is a little bit hidden, so I understand why it would spark a question like this. The only other 'trick' I know is the last and first functions, which you can nest if you need to. e.g. this will get the last 2 days of the first 3 weeks.

    last(first(my_xts, "3 weeks"), "2 days")
    

提交回复
热议问题