RobinHankin / disordR

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

bug in disords of disords #21

Open RobinHankin opened 3 years ago

RobinHankin commented 3 years ago

It should be possible to have a disord object which is a list whose elements are themselves disord objects. But:

> disord(list(disord(1:3),disord(5:8),disord(8:18)))
Error: sha1() has no method for the 'disord' class
> 
RobinHankin commented 3 years ago

This is discussed in the vignette, type vignette("sha1") and there is a section Creating a sha1 method for other classes

RobinHankin commented 2 years ago

The bug is triggered by the following simpler call:

> disord(disord(1:10))
Error: sha1() has no method for the 'disord' class
> 
RobinHankin commented 1 year ago

The obvious fix, viz:

`sha1.disord` <- function(x, digits = 4, zapsmall = 7) {
  sha1(elements(x), digits = digits, zapsmall = zapsmall)
}

Does not work:

> disord(list(disord(1:2),disord(1:5)))
Error in sha1.disord(X[[i]], ...) : unused argument (algo = "sha1")
>