alexeckert / parallelDist

R Package: Parallel Distance Matrix Computation using Multiple Threads
GNU General Public License v2.0
49 stars 9 forks source link

Labels attributed missing in output #10

Closed codetrainee closed 5 years ago

codetrainee commented 5 years ago

Thanks for the fantastic packages. It really saved me a lot of time in my project. But I found a subtle difference in the parDist() output compared to dist() in base packages. The Labels attribute is gone. Here is the reproducible example.

m <- matrix(1:12, 4)
colnames(m) <- c("A", "B", "C")
rownames(m) <- c("a", "b", "c", "d")

str(dist(m))
#>  'dist' num [1:6] 1.73 3.46 5.2 1.73 3.46 ...
#>  - attr(*, "Size")= int 4
#>  - attr(*, "Labels")= chr [1:4] "a" "b" "c" "d"
#>  - attr(*, "Diag")= logi FALSE
#>  - attr(*, "Upper")= logi FALSE
#>  - attr(*, "method")= chr "euclidean"
#>  - attr(*, "call")= language dist(x = m)
str(parallelDist::parDist(m))
#>  'dist' num [1:6] 1.73 3.46 5.2 1.73 3.46 ...
#>  - attr(*, "Size")= int 4
#>  - attr(*, "Diag")= logi FALSE
#>  - attr(*, "Upper")= logi FALSE
#>  - attr(*, "method")= chr "euclidean"
#>  - attr(*, "call")= language parallelDist::parDist(x = m)

Created on 2018-11-13 by the reprex package (v0.2.0).

alexeckert commented 5 years ago

Thanks, should be fixed with https://github.com/alexeckert/parallelDist/commit/3835e67fd730422ea957bc1216f0838395796fd6

codetrainee commented 5 years ago

Excellent. Thanks for your effort.