Monday, May 6, 2013

Spinning 3D MDS plot in R

I did the classical MDS on my data and drew 3D spinning MDS plot and here is the code:
(Note that this code uses vegan, MASS, and rgl packages and the plot below was made in R 2.15.3)


And here is the plot:



Yay!

And yes now here is the data format:
In first column are names of different samples and in next columns abundance of different classes of bacteria. 

Sample A   sp1   sp2   sp3   sp4 ...
Sample B   sp1   sp2   sp3   sp4 ...
Sample C   sp1   sp2   sp3   sp4 ...
.
.

 

9 comments:

  1. Awesome! Tell me what you've done - what does the plot tell us? What would happen if k is increased to 300? ;)

    ReplyDelete
    Replies
    1. If k is increased to higher numbers, say 300, it will be more difficult to listen to what ever the MDS is telling us. However, it we will be more informative (and as said earlier not well understood/useful.) +
      Plots always tell only what they tell. We hear, and at times we hear things that plots do not really tell.

      Delete
  2. Replies
    1. Marjorie, MDS is Multidimensional scaling.

      Delete
  3. rdl package is amazing!!! Thank you

    ReplyDelete
    Replies
    1. It is Dan :)
      If you have interesting codes I would love to learn more!

      Delete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Hi Gargi,

    I was wondering if you have released the data for this example because I would like to see how the data is formatted.

    P

    ReplyDelete
    Replies
    1. Sure Peter. Apologizes for taking long to reply. We are in process of publishing our data and as soon as that happens ( in a month or so) I will publish here some parts of the data at very least. So, do check back for data format. Meanwhile, I might just make up random numbers to give an idea and put that up here in couple of days.

      Delete