[adegenet-forum] Change color in scatter.dapc()

Roman Luštrik roman.lustrik at biolitika.si
Sat Sep 12 12:26:54 CEST 2020


It would seem it is currently impossible to color points individually. To do that, you'll have to either make a new version of the plot or draw the figure anew.



https://github.com/thibautjombart/adegenet/blob/e7e57ac38132e3104035c386310d7b571e1d2c42/R/dapc.R#L584



Cheers,

Roman



--- 

“If we have data, let’s look at data. If all we have are opinions, let’s go with mine.” -- Jim Barksdale







---- On Sat, 12 Sep 2020 08:57:58 +0200 Roman Luštrik <roman.lustrik at biolitika.si> wrote ----


By now you probably know the membership of each individual. Just assign them colors and pass that to the `col` parameter.



library(adegenet)



data(H3N2)

dapc1 <- dapc(H3N2, pop=H3N2$other$epid, n.pca=30,n.da=6)



custom.cols <- sample(c("red", "black"),

                      size = nInd(H3N2),

                      prob = c(0.2, 0.8),

                      replace = TRUE)



scatter(dapc1, col = custom.cols)



Cheers,

Roman




--- 

“If we have data, let’s look at data. If all we have are opinions, let’s go with mine.” -- Jim Barksdale







---- On Sat, 12 Sep 2020 08:17:54 +0200 Das, Roma (ICRISAT-IN) <mailto:r.das at cgiar.org> wrote ----



Hello,

I have a scatter plot with 20 groups (using on find.cluster() using 1200 individuals). However I want to use only two color for individuals in same scatter plot with 20 groups.

 

Thanks in advance.

 

Regards,

Roma



_______________________________________________
adegenet-forum mailing list
mailto: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/20200912/6f115250/attachment.html>


More information about the adegenet-forum mailing list