For this tutorial series, we will be using the genlight object that we created in the previous tutorial. Original data in HapMap format used in TASSEL was converted to genlight object. Here b will be our genlight object that we previously created in Tutorial P01.

Import library

library(LDcorSV)
library(adegenet)
library(ggplot2)
library(scales)
library(tidyverse)
library(dpaudelR)

Run DAPC

dapc1 <- dapc(b, grp$grp) # pcs=25 (around 80%) and linear discriminants = 2

Plot DAPC

scatter(dapc1, posi.da='topleft', bg="white", pch=17:19)