plotPolarized {diemr}R Documentation

Plots polarized genotypes

Description

Plots genotypes that can be optionally polarized.

Usage

plotPolarized(
  genotypes,
  HI,
  cols = c("#FFFFFF", "#800080", "#FFE500", "#008080"),
  ...
)

Arguments

genotypes

character matrix comprising of _012 encodings.

HI

numeric vector of individual hybrid indices with length equal to number of rows in genotypes.

cols

vector of four colours, representing missing data, homozygots for genotype 0, heterozygots and homozygots for genotype 2.

...

additional arguments.

Details

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.

Value

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.

Examples

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)

[Package diemr version 1.2.2 Index]