graph_f2_function: Make a function representing a graph

graph_f2_functionR Documentation

Make a function representing a graph

Description

This function takes an igraph object and turns it into a function that takes edge weights as input, and outputs the expected f2-statistics.

Usage

graph_f2_function(
  graph,
  admix_default = 0.5,
  drift_default = 0.01,
  random_defaults = FALSE
)

Arguments

graph

An admixture graph

admix_default

The default weights for admixture edges

drift_default

The default weights for drift edges

random_defaults

Set default weights randomly for each edge between 0 and 1

Value

A function mapping edge weights to f2-statistics

Examples

## Not run: 
mygraph = graph_f2_function(example_igraph)
mygraph(N3N8 = 0.1, `N2N1|Vindija.DG` = 0.4)

## End(Not run)

uqrmaie1/admixtools documentation built on Nov. 3, 2024, 12:56 a.m.