RobinHankin / frab

1 stars 0 forks source link

colnames of index matrix get lost #17

Closed RobinHankin closed 1 year ago

RobinHankin commented 1 year ago
suppressMessages(library("frab"))
I <- matrix(sample(letters[1:4],15,replace=T),ncol=3)
colnames(I) <- state.abb[1:3]
I
#>      AL  AK  AZ 
#> [1,] "b" "b" "c"
#> [2,] "d" "a" "b"
#> [3,] "c" "b" "a"
#> [4,] "c" "a" "d"
#> [5,] "b" "a" "b"
sparsetable(I)
#>            val
#>  b a b  =    1
#>  b b c  =    1
#>  c a d  =    1
#>  c b a  =    1
#>  d a b  =    1

Created on 2023-08-11 with reprex v2.0.2

RobinHankin commented 1 year ago

Observe that the rownames cannot possibly be set: the index matrix might lose rows, and in any case this would violate disordR discipline