This merely converts a matrix to a tibble that can be plotted easily using ggplot.

amm2tibble(M)

Arguments

M

an ancestry-match matrix

Value

amm2tibble() returns a tibble with three columns:

  • x: the 1-based index of the row of input matrix,

  • y: the 1-based index of the column of the input matrix,

  • amm: the logical value (TRUE/FALSE) of the (x,y)-th cell of the input matrix.

Examples

# convert one of the simple example AMMs to a tibble
amm2tibble(example_amms$Father_Offspring_2gen)
#> # A tibble: 49 × 3
#>        x     y amm  
#>    <int> <int> <lgl>
#>  1     1     1 FALSE
#>  2     2     1 TRUE 
#>  3     3     1 FALSE
#>  4     4     1 FALSE
#>  5     5     1 FALSE
#>  6     6     1 FALSE
#>  7     7     1 FALSE
#>  8     1     2 FALSE
#>  9     2     2 FALSE
#> 10     3     2 FALSE
#> # ℹ 39 more rows