RobinHankin / disordR

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

extracting no elements bug #33

Closed RobinHankin closed 2 years ago

RobinHankin commented 2 years ago
> x <- 1:3
> x[F]
integer(0)
> x[c(F,F,F)]
integer(0)
> 
> x <- disord(1:3)
> x[F]
Error in .local(x, i, j = j, ..., drop) : 
  if using a regular index to extract, must extract each element once and once only
> x[c(F,F,F)]
Error in .local(x, i, j = j, ..., drop) : 
  if using a regular index to extract, must extract each element once and once only
> 

When x is an integer the extraction works fine, but when x is a disord, it fails even though I would expect the same result. This actually affects the clifford package (which fails a test if we change the default of disord() to be disord(...,drop=TRUE)).