View source: R/PopGenBounds_functions.R
ggbounds | R Documentation |
Plots differentiation statistics along with the maximal and minimal values of the statistic
ggbounds(M, FST, GpST = NULL, D = NULL, K = 2)
M |
Numerical vector of frequency of the most frequent allele for each locus |
FST |
Numerical vector of FST values for each locus |
GpST |
Numerical vector of G prime ST values for each locus |
D |
Numerical vector of D values for each locus |
K |
Number of subpopulations |
A ggplot object
library(tidyverse)
freqs_locus1 <- matrix(c(1,0.5,0,0.5),nrow=2)
freqs_locus2 <- matrix(c(1,0.8,0,0.2),nrow=2)
freqs_locus3 <- matrix(c(1,0.2,0,0.8),nrow=2)
data <- rbind(Diff(freqs_locus1),Diff(freqs_locus2),Diff(freqs_locus2))
ggbounds(M=data %>% filter(statistic=="M") %>% pull(value),FST=data %>% filter(statistic=="FST") %>% pull(value))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.