[adegenet-forum] DAPC a priori grouping

Virgilio Massimiliano massimiliano.virgilio at africamuseum.be
Tue Nov 18 15:03:08 CET 2014


Dear Thibaud,
I’m trying to group populations of a genind object according to region and country of origin.
The idea was to perform DAPCs and maximise differences between individuals from different regions/countries.

I first added the region/country info to the @other slot of the genind object and then tried to perform DAPC:

dapc_region <- dapc(data, grp=data at other$region, scale=FALSE, n.pca=20, n.da=5)

yet, all I could get was a DAPC using populations as defined by the @pop slot,

so I tried and modify the @pop slot

region=read.table(“region.txt",head=T)
data841 at pop<-region

but I got:

Error in checkAtAssignment("genind", "pop", "data.frame") :
 assignment of an object of class "data.frame" is not valid for @'pop' in an object of class "genind"; is(value, "factorOrNULL") is not TRUE

Is this just something I cannot do on a genind object?
any suggestion on how to easily change the apriori grouping of individuals (@pop) and perform DAPC

many thanks in advance and all the best

Massi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141118/be4c4ee4/attachment.html>


More information about the adegenet-forum mailing list