RobinHankin / disordR

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

logic for disord objects #12

Closed RobinHankin closed 3 years ago

RobinHankin commented 3 years ago

I didn't think I'd need to implement logic, so didn't do it, but:

> a <- rdis(6)
> a
A disord object with hash ee2f3004f17069125d8c30d8d368953679cc50e6 and elements
[1] 0.7008326 0.2164962 0.3027965 0.2725064 0.5944444 0.9378613
(in some order)
> a>0.3
A disord object with hash ee2f3004f17069125d8c30d8d368953679cc50e6 and elements
[1]  TRUE FALSE  TRUE FALSE  TRUE  TRUE
(in some order)
> a < 0.9
A disord object with hash ee2f3004f17069125d8c30d8d368953679cc50e6 and elements
[1]  TRUE  TRUE  TRUE  TRUE  TRUE FALSE
(in some order)
> (a>0.3) & (a<0.9)
Error in (a > 0.3) & (a < 0.9) : 
  No logic currently implemented for disord objects
> 

above, I would expect the last line to give an appropriate Boolean disord object.