RobinHankin / disordR

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

error #10

Closed RobinHankin closed 3 years ago

RobinHankin commented 3 years ago
> a <- rdis()
> x <- a^2 + 0.2
> a[a<0.5] <- x[a<0.5]
Error in .local(x, i, j = j, ..., value) : 
  consistent(x[i], value) is not TRUE
>

I think the last line above should not be an error: it has a clear meaning.

RobinHankin commented 3 years ago

The problem is at setMethod("[", signature("disord",i="disord",j="missing",drop="ANY"). In particular,

out <- disord(out, digest::sha1(out)) # NB newly generated hash

which is too random in the sense that it does not record the fact that if i1 and i2 have the same hash, then x[i1] and x[i2]` should also have the same hash.