Closed AndiMunteanu closed 8 months ago
Thanks for letting me know about this. Unfortunately, the proposed fix doesn't quite work.
diris <- stats::dist(iris[1:10, -5])
methods::is(diris, "dist")
[1] TRUE
methods::is(diris, "stats::dist")
[1] FALSE
This may require some research.
Thank you for the very quick response! You are right, sorry for suggesting a wrong solution!
Would replacing methods::is
with inherits
or something more custom (like attributes(diris)$class == "dist"
) keep the code consistent and remove the warning?
inherits
seems to do the trick. Thank you for the suggestion. A fix has been pushed to master
and this should be in the next CRAN release.
Thank you very much, your work is much appreciated! I will close this issue, since the problem was fixed.
Hello!
Thank you for creating and mantaining this very useful package! I noticed this warning that pops up when creating the UMAP:
Found more than one class "dist" in cache; using the first, from namespace 'BiocGenerics' Also defined by 'spam'
This is an example that could help reproduce the problem:
The
spam
package is usually loaded together withSeurat
andBiocGenerics
withrhdf5
, so at least in my use-case I can't avoid getting this warning. I think that this warning is caused by an ambiguous definition of thedist
class in theneghbors.R
anduwot.R
files, more precisely on these lines:https://github.com/jlmelville/uwot/blob/3bff01f86758151880c17a3ca1db0665aa9cf8b7/R/neighbors.R#L14
https://github.com/jlmelville/uwot/blob/3bff01f86758151880c17a3ca1db0665aa9cf8b7/R/uwot.R#L3204
https://github.com/jlmelville/uwot/blob/3bff01f86758151880c17a3ca1db0665aa9cf8b7/R/uwot.R#L4266
Replacing
"dist"
with"stats::dist"
in these lines should fix this issue.Thank you!