You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unique() doesn't appear to be defined for class Interval, yet it silently runs and produces results that (I think) don't make sense.
example:
foo<- Sys.time() + days(1:4)
ints<- rep(interval(head(foo, -1), tail(foo, -1)), 2)
## each interval is the same _duration_, and unique(ints) simply returns the unique durations (in seconds).## would (reasonably) expect the 3 unique _intervals_, instead.
unique(ints)
## [1] 86400
The text was updated successfully, but these errors were encountered:
quick add on why this could be useful: stratification by interval, e.g. by creating interval factors:
## continuing the example code from above...factor(ints)
## [1] <NA> <NA> <NA> <NA> <NA> <NA>## Levels: 86400foo<-data.frame(x=1:6, ints=ints)
## if dlply-ing over ints, would expect a length-3 vector of 2s... instead it's a length-1 vector of 6:
unlist(dlply(foo, .(ints), nrow))
unique() doesn't appear to be defined for class Interval, yet it silently runs and produces results that (I think) don't make sense.
example:
The text was updated successfully, but these errors were encountered: