joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
567 stars 187 forks source link

Sudden Error with the distance() function #1688

Closed Aliceall closed 1 year ago

Aliceall commented 1 year ago

Hi! I have started having this sudden error with the distance() function in phyloseq. I did not have this error few weeks ago. Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'distance' for signature '"phyloseq", "missing"' Script is: jacc_distance = distance(data, method = 'jaccard') Other functions work well. I have R4.1.2 phyloseq 1.44 Please let me know if you have any clue! Thank you very much

ycl6 commented 1 year ago

Hi @Aliceall

You've probably loaded a R package that has a function also named distance that has taken precedence. You can use phyloseq::distance() to explicitly use the distance function from phyloseq.

Aliceall commented 1 year ago

Thank you @ycl6! Such an easy fix...I hadn't really thought of it.