Hi, all.


I will output MDS plot with ggplot2.

But, I couldn’t read the data because the class of the data wasn’t support in ggplot2.
Is there a way to convert “dist” to “data.frame”?

Although I tried “as.data.frame()“, I was not able to do.
The following error messages was outputed.

    > as.data.frame(d)
    Error in as.data.frame.default(d) : 
      cannot coerce class ‘"dist"’ to a data.frame

I'm a beginner in bioinformatics, so sorry for the basic question.
Could you please advise me?
Thank you very much for your appreciated!
You have a specific function designed to perform this in the `metagMisc` package :

    devtools::install_github("vmikk/metagMisc")
    library("metagMisc")
    dist2list(d, tri = TRUE)

You have also plenty other solutions as you may find [here][1].


  [1]: https://stackoverflow.com/questions/23474729/convert-object-of-class-dist-into-data-frame-in-r