Skip to content

Commit

Permalink
pcnm failed if all distances == 0
Browse files Browse the repository at this point in the history
(cherry picked from commit dfa6125)
  • Loading branch information
jarioksa committed Nov 11, 2020
1 parent 0d029fb commit 586ac47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/pcnm.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
weights = mypcnm$weig)
k <- ncol(mypcnm$points)
res$vectors <- sweep(res$vectors, 2, sqrt(res$values[seq_len(k)]), "/")
colnames(res$vectors) <- paste("PCNM", 1:k, sep="")
if (NCOL(res$vectors))
colnames(res$vectors) <- paste("PCNM", 1:k, sep="")
res$threshold <- threshold
if (dist.ret) {
attr(dis, "method") <- paste(attr(dis, "method"), "pcnm")
Expand Down

0 comments on commit 586ac47

Please sign in to comment.