RobinHankin / permutations

https://robinhankin.github.io/permutations/
5 stars 3 forks source link

`shape()` infelicity #36

Closed RobinHankin closed 1 year ago

RobinHankin commented 1 year ago

Look:

> (a <- rperm())
 [1] (135742)      (154632)      (1362547)     (27)(365)     (17)(26)(45) 
 [6] (14)(275)(36) (152)(3764)   (1342)(567)   (13742)(56)   (15236)(47)  
[coerced from word form]
> identical(shape(a),shape(a^cyc_len(2)))
[1] FALSE
> 

As shape.Rd says, the lengths are returned in the order given by nicify_cyclist(), which is why we get a FALSE above. It would be nice to have a sort argument toshape(), defaulting to FALSE.