from_igraph: Convert igraph to population

View source: R/igraph.R

from_igraphR Documentation

Convert igraph to population

Description

Convert igraph to population

Usage

from_igraph(x, ...)

Arguments

x

igraph, must be a forest of directed trees with unique positive integer names (as they will be pid's)

...

Ignored

Value

A population

Examples

g <- igraph::graph_from_literal( 2 +- 1 -+ 3, 4 -+ 5 )
plot(g)
pop <- from_igraph(g)
peds <- build_pedigrees(pop, progress = FALSE)
plot(peds)
infer_generations(peds)
get_generation(get_individual(pop, 1))
get_generation(get_individual(pop, 2))
get_generation(get_individual(pop, 3))
get_generation(get_individual(pop, 4))
get_generation(get_individual(pop, 5))


malan documentation built on July 4, 2024, 9:09 a.m.