I just ran a redundancy analysis on my SNP dataset, and I have candidate SNPs from it. I would like to run a DAPC on this data, but the tutorial has left me a little confused. This is because I believe I already have my data in the clusters and I would just like to run the DAPC, but it's just not working for some reason due to these errors, and I believe I'm doing something wrong before I even get to this point, but I don't know what
Asked
Active
Viewed 67 times
0
-
Going through the code I definitely did something wrong there (and I totally get the documentation being really long). The problem I am running into now is the "SNP" column is a factor, and I need it in numeric form. But when I type "cand1$snp <- as.numeric(cand1$snp) it just changes the data in that column to "1,2,3,4,5...". I did get the data to plot when I converted the snp column from factor to numeric, it's just that it got converted to something that isn't my data. Do you think you can help me out here? – Daniel.Payter Mar 04 '20 at 21:06
-
I just added the line of code that got me to the error, I'm starting to think I don't even need the SNP column, but I'm not sure – Daniel.Payter Mar 04 '20 at 21:47
-
find.cluster works on " ‘a data.frame’, ‘matrix’, or ‘genind’ object. For the ‘data.frame’ and ‘matrix’ arguments, only quantitative variables should be provided. – StupidWolf Mar 04 '20 at 22:06
-
Yes, you don't need the SNP column, but you have only one column with a variable. It's doesn't make sense to do PCA on one vector right. You need to get back your original data and let find.cluster do the PCA and clustering – StupidWolf Mar 04 '20 at 22:07
-
So maybe I should combine all three datasets into one large column and do it then? Basically making 3 separate groupings within the dataset? – Daniel.Payter Mar 04 '20 at 22:08
-
Hey.. i don't understand what you mean by making 3 groupings. what you basically need, is more than 1 variable to do clustering. – StupidWolf Mar 04 '20 at 22:16