<div dir="ltr">Hi Carlo, <div><br></div><div>I think something like this might work (shown on example data):</div><div><br></div><div><div><font color="#0000ff">library(adegenet)</font></div><div><font color="#0000ff"><br></font></div><div><font color="#6aa84f">## eg data</font></div><div><font color="#0000ff">data(dapcIllus)</font></div><div><font color="#0000ff">x <- dapcIllus$a</font></div><div><font color="#0000ff">grp <- find.clusters(x, max.n.clust=40, n.pca=200) # choose k = 6</font></div><div><font color="#0000ff"><br></font></div><div><font color="#6aa84f">## this is the plot you wanted to use as an inset, correct?</font></div><div><font color="#0000ff">plot(grp$Kstat, type="o", col="blue")</font></div><div><font color="#0000ff"><br></font></div><div><font color="#6aa84f">## dapc</font></div><div><font color="#0000ff">dapc1 <- dapc(x, grp$grp, n.pca=40, n.da=5)</font></div><div><font color="#0000ff"><br></font></div><div><font color="#6aa84f">## plot dapc</font></div><div><font color="#0000ff">scatter(dapc1, scree.da=FALSE, bg="white",</font></div><div><font color="#0000ff"> scree.pca=TRUE, posi.pca="bottomleft",</font></div><div><font color="#0000ff"> cstar=1, cellipse=1)</font></div><div><font color="#0000ff"><br></font></div><div><font color="#6aa84f">## add BIC curve as inset!</font></div><div><font color="#0000ff">myInset <- function(){</font></div><div><font color="#0000ff"> plot(grp$Kstat, type="o", col="blue")</font></div><div><font color="#0000ff">}</font></div><div><font color="#0000ff">add.scatter(myInset(), posi="bottomright",</font></div><div><font color="#0000ff"> inset=c(-0.03,-0.01), ratio=.2,</font></div><div><font color="#0000ff"> bg=transp("white"))</font></div></div><div><br></div><div>I hope that gets you close to what you were hoping for. Let me know if for some reason it does not though! </div><div><br></div><div>Note that most of the code above can be found scattered throughout adegenet's very lovely and always useful <a href="http://adegenet.r-forge.r-project.org/files/tutorial-dapc.pdf">dapc tutorial</a>. </div><div><br></div><div>All the best, </div><div>Caitlin. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 26, 2015 at 1:47 PM, carlo pecoraro <span dir="ltr"><<a href="mailto:carlo_3486@hotmail.it" target="_blank">carlo_3486@hotmail.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><span style="font-family:Tahoma;font-size:13.3333px">Hi </span><span style="font-family:Tahoma;font-size:10pt;white-space:pre-wrap">Thibaut and all,</span><div style="font-family:Tahoma;font-size:13.3333px"><span style="white-space:pre-wrap;font-size:10pt"><br></span></div><div style="font-family:Tahoma;font-size:13.3333px"><span style="white-space:pre-wrap">is it possible to add the graph of the Value of BIC versus number of clusters in the resulting scatterplot od the DAPC? </span></div><div style="font-family:Tahoma;font-size:13.3333px"><span style="white-space:pre-wrap">I would like to show it togheter with the PCA eigenevalues</span></div><div style="font-family:Tahoma;font-size:13.3333px"><span style="white-space:pre-wrap"><br></span></div><div style="font-family:Tahoma;font-size:13.3333px"><span style="white-space:pre-wrap">Many thanks.</span></div><div style="font-family:Tahoma;font-size:13.3333px"><span style="white-space:pre-wrap">Cheers</span></div><span class="HOEnZb"><font color="#888888"><div style="font-family:Tahoma;font-size:13.3333px"><span style="white-space:pre-wrap">Carlo</span></div> </font></span></div></div>
<br>_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br></blockquote></div><br></div>