plotPolarized {diemr} | R Documentation |
Plots genotypes that can be optionally polarized.
plotPolarized(
genotypes,
HI,
cols = c("#FFFFFF", "#800080", "#FFE500", "#008080"),
...
)
genotypes |
character matrix comprising of _012 encodings. |
HI |
numeric vector of individual hybrid indices with length equal to number
of rows in |
cols |
vector of four colours, representing missing data, homozygots for genotype 0, heterozygots and homozygots for genotype 2. |
... |
additional arguments. |
To import and polarize genotypes, use the function importPolarized
.
When using diem
with argument verbose = TRUE
, hybrid indices,
HI
, can be found in file 'HIwithOptimalPolarities.txt' in folder 'diagnostics'
in the working directory.
No return value, called for side effects. In the default plot, purple and green
represent side of the barrier to geneflow encoded as 0
and 2
, respectively,
yellow shows heterozygots and white missing or undetermined genotypes. Individuals
are ordered according to the HI
.
gen <- importPolarized(
file = system.file("extdata", "data7x10.txt", package = "diemr"),
changePolarity = c(TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE),
ChosenInds = 1:7
)
h <- c(0.625, 0.5, 0.455, 0.455, 0.227, 0.818, 0.292)
plotPolarized(genotypes = gen, HI = h)