[adegenet-forum] DAPC on morphometric data

Gotzek, Dietrich GotzekD at si.edu
Tue Dec 7 20:24:48 CET 2010


Hi,
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): 
8
Choose the number of clusters (>=2: 
3
> 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:
> is.matrix(morph.data)
[1] TRUE

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!
Thanks,
Dietrich 

Dietrich Gotzek
Department of Entomology
National Museum of Natural History
Smithsonian Institution
PO Box 37012, MRC 188, NHB, Rm. CE-509
Washington, DC 20013-7012 

phone: (202) 633-1003
email: gotzekd at si.edu


More information about the adegenet-forum mailing list