RobinHankin / disordR

https://robinhankin.github.io/disordR/
1 stars 0 forks source link

empty disord objects should be dropped too #34

Closed RobinHankin closed 2 years ago

RobinHankin commented 2 years ago

If an extraction operation returns a disord object with zero elements, it really should drop() the result. But:

> a <- disord(1:5)
> a[a>6]
A disord object with hash c8d5cf2b423f09441a6e59a0bb2b2f6cd152d234 and elements
integer(0)
(in some order)
> 

Also, drop() does not behave as expected:

 a <- disord(1:5)
> o <- a[a>6]
> o
A disord object with hash c8d5cf2b423f09441a6e59a0bb2b2f6cd152d234 and elements
integer(0)
(in some order)
> drop(o)
A disord object with hash c8d5cf2b423f09441a6e59a0bb2b2f6cd152d234 and elements
integer(0)
(in some order)
>