RobinHankin / disordR

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

rbind() problem #56

Closed RobinHankin closed 3 weeks ago

RobinHankin commented 3 months ago

It seems that rbind() also breaks disord discipline:

library("disordR")
#> Loading required package: Matrix
a <- disord(1:4)
b <- disord(3:6)
a
#> A disord object with hash 11fa109a6deac2dfbbeb9f053cd90967c9124939 and elements
#> [1] 1 2 3 4
#> (in some order)
b
#> A disord object with hash 491353726f5e17112f30f86083f1add0921a0c0e and elements
#> [1] 3 4 5 6
#> (in some order)
rbind(a,b)
#>   [,1] [,2] [,3] [,4]
#> a    1    2    3    4
#> b    3    4    5    6

Above we see that rbind(a,b) is effectively rbind(elements(a),elements(b)) and has therefore imposed an arbitrary ordering on its arguments (even though the hash codes for a and b differ). This is closely related to issue #23 and it might be better to collect them together.