tidyverts / tsibble

Tidy Temporal Data Frames and Tools
https://tsibble.tidyverts.org
GNU General Public License v3.0
528 stars 50 forks source link

scan_gaps(nyc_bikes) fails with error `x Neither `+` nor `seq()` are defined for class POSIXct` #240

Closed cregouby closed 3 years ago

cregouby commented 3 years ago

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

What output is expected

This is a manual edit :

scan_gaps(nyc_bikes) %>% 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
...

Reproductible example

# insert reprex here
library(tsibble)
scan_gaps(tsibbledata::nyc_bikes)
earowang commented 3 years ago

I've opened a ticket on {tsibbledata} https://github.com/tidyverts/tsibbledata/issues/16 nyc_bikes should be a tsibble of irregular interval, and therefore *_gaps() do not work with irregular tsibble.