Skip to content

index support for {lubridate} start - end interval #245

@cregouby

Description

@cregouby

Brief description of the problem
*_gaps are a very usefull set of commands. And I would love to be able to use them on irregular longitudinal data with start and stop index columns, like tsibbledata::nyc_bikes.

Currently, irregular interval tsibble are not supported by *_gaps function family

What output is expected

This is a manual edit :

nyc_bikes_dual_index <- build_tsibble(tsibbledata::nyc_bikes, key = bike_id, index=start_time, index2=stop_time)
scan_gaps(nyc_bikes_dual_index) %>% head(3)

# A tsibble: 4,258 x 12 [0.0149047991726547µs] <America/New_York>
# Key:       bike_id [10]
   bike_id start_time          stop_time           
   <fct>   <dttm>              <dttm>              
 1 26301    2018-02-26 19:15:40 2018-02-27 07:52:49
 2 26301    2018-02-27 07:58:13 2018-02-27 12:03:27
 3 26301    2018-02-27 12:04:54 2018-02-27 13:53:51

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions