1

This is my first post on here so I hope I don't break any rules! I have a set of 30snps sampled from 450 individuals. I have performed an MDS on my dataset and a cluster analysis. In both cases I have obtained two distinct groups. I would like to see if the individuals in the two groups are the same both for the MDS and the cluster analysis. Do you have any suggestions on how I could solve this?

Thanks for your help!

1 Answers1

1

If you've got two vectors, you can see how they differ using setdiff():

set1 <- c(1, 2, 3, 4, 5)
set2 <- c(2, 3, 4, 5, 6)

# what elements are in set1 but not in set2?
setdiff(set1, set2)
[1] 1
Stewart Macdonald
  • 2,062
  • 24
  • 27
  • Thanks! I thought of using the function table() but I don't know how to create the two vectors. For the MDS maybe I can use the $points (it is a non metric MDS), but for the cluster analysis I have no idea how to extract the data from the cluster analysis itself. Sorry, I hope I am not too confusing! – Beatrice Baldi Jun 07 '17 at 08:58
  • If you update your original question to include some more details (e.g., sample data and the code that you're using to do the MDS and cluster analysis), people might be able to help further. – Stewart Macdonald Jun 07 '17 at 09:18
  • Thank you, I was able to manipulate my data in order to use the function setdiff. It worked! – Beatrice Baldi Jun 10 '17 at 09:24