ggbounds: Plots differentiation statistics along with the maximal and...

View source: R/PopGenBounds_functions.R

ggboundsR Documentation

Plots differentiation statistics along with the maximal and minimal values of the statistic

Description

Plots differentiation statistics along with the maximal and minimal values of the statistic

Usage

ggbounds(M, FST, GpST = NULL, D = NULL, K = 2)

Arguments

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

Value

A ggplot object

Examples

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))

nalcala/PopGenBounds documentation built on Jan. 23, 2025, 7:22 p.m.