[adegenet-forum] DAPC on morphometric data
t.jombart at imperial.ac.uk
Tue Dec 7 21:50:35 CET 2010
It seems to be a typo; you did not perform the DAPC on your morphometric data, but tried it on on a list called grp.
morph.dapc <- dapc(morph.data, pop=morph.clust$grp, n.pca=NULL, n.da=NULL)
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] On Behalf Of Gotzek, Dietrich [GotzekD at si.edu]
Sent: 07 December 2010 19:24
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] DAPC on morphometric data
I'd like to know if anyone has tried using DAPC on morphometric data, as mentioned in the paper. I've tried (unsuccessfully), using a dataset of 30 individuals and 14 measurements with the following commands:
> morph.data <- as.matrix(read.csv("/Users/dgotzek/morphometric.csv", header=F, sep = ","))
> morph.clust <- find.clusters(morph.data, n.pca=NULL, n.clust=NULL)
Choose the number PCs to retain (>=1):
Choose the number of clusters (>=2:
> morph.dapc <- dapc(grp, pop=morph.clust$grp, n.pca=NULL, n.da=NULL)
Error in UseMethod("dapc") :
no applicable method for 'dapc' applied to an object of class "list"
I was surprised by this, so I asked:
The dapc help function states that "dapc performs the DAPC on a data.frame, a matrix, or a genind object, and returns an object with class dapc. If data are stored in a data.frame or a matrix, these have to be quantitative data (i.e., numeric or integers), as opposed to characters or factors.", which is given in my case. So what am I doing wrong? I tried various was to import various formats of the data (read.table, read.csv, etc), but nothing worked...
Any help is appreciated!
Department of Entomology
National Museum of Natural History
PO Box 37012, MRC 188, NHB, Rm. CE-509
Washington, DC 20013-7012
phone: (202) 633-1003
email: gotzekd at si.edu
adegenet-forum mailing list
adegenet-forum at lists.r-forge.r-project.org
More information about the adegenet-forum