ggcompoplot: Plot posterior values from DAPC analysis in adegenet

Description Usage Arguments Value Examples

Description

Plot posterior values from DAPC analysis in adegenet

Usage

1
ggcompoplot(da.object, gid, pal = rainbow, cols = 1)

Arguments

da.object

an object of class "dapc"

gid

an object of class "genind"

pal

a color palette

cols

the number of columns to display

Value

a ggplot object with each population stacked on top of each other.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library('adegenet')
library('ggcompoplot')
library('ggplot2')
data(microbov)
strata(microbov) <- data.frame(other(microbov))
dapc1 <- dapc(microbov, n.pca=20, n.da=15)
setPop(microbov) <- ~breed
compoplot(dapc1, lab="") # Adegenet compoplot
# Showing per breed
ggcompoplot(dapc1, microbov) + theme(axis.text.x = element_blank())
## Not run: 

# 3 columns
ggcompoplot(dapc1, microbov, col = 3) + theme(axis.text.x = element_blank())

# Different color palette
ggcompoplot(dapc1, microbov, col = 3, pal = funky) + theme(axis.text.x = element_blank())

# Per Country
setPop(microbov) <- ~coun
ggcompoplot(dapc1, microbov) + theme(axis.text.x = element_blank())

## End(Not run)

zkamvar/ggcompoplot documentation built on May 4, 2019, 11:24 p.m.