[adegenet-forum] Value of BIC versus number of clusters

Caitlin Collins caitiecollins at gmail.com
Thu Nov 26 16:38:23 CET 2015


Hi Carlo,

I think something like this might work (shown on example data):

library(adegenet)

## eg data
data(dapcIllus)
x <- dapcIllus$a
grp <- find.clusters(x, max.n.clust=40, n.pca=200) # choose k = 6

## this is the plot you wanted to use as an inset, correct?
plot(grp$Kstat, type="o", col="blue")

## dapc
dapc1 <- dapc(x, grp$grp, n.pca=40, n.da=5)

## plot dapc
scatter(dapc1, scree.da=FALSE, bg="white",
        scree.pca=TRUE, posi.pca="bottomleft",
        cstar=1, cellipse=1)

## add BIC curve as inset!
myInset <- function(){
  plot(grp$Kstat, type="o", col="blue")
}
add.scatter(myInset(), posi="bottomright",
            inset=c(-0.03,-0.01), ratio=.2,
            bg=transp("white"))

I hope that gets you close to what you were hoping for. Let me know if for
some reason it does not though!

Note that most of the code above can be found scattered throughout
adegenet's very lovely and always useful dapc tutorial
<http://adegenet.r-forge.r-project.org/files/tutorial-dapc.pdf>.

All the best,
Caitlin.

On Thu, Nov 26, 2015 at 1:47 PM, carlo pecoraro <carlo_3486 at hotmail.it>
wrote:

> Hi Thibaut and all,
>
> is it possible to add the graph of the Value of BIC versus number of
> clusters in the resulting scatterplot od the DAPC?
> I would like to show it togheter with the PCA eigenevalues
>
> Many thanks.
> Cheers
> Carlo
>
> _______________________________________________
> adegenet-forum mailing list
> adegenet-forum at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20151126/d3a89d46/attachment.html>


More information about the adegenet-forum mailing list