R/seg2tib.R
seg2tib.Rd
A small helper function.
seg2tib(s)
a gamete in segment format
Returns a tibble with columns tmp_seg_names
, start
, and end
,
that show the origin (in tmp_seg_names
) of segments that start at start
and end at end
.
# first make a segment that has pieces from a few different founders
V <- c(Amy = 0, Bob = 10000, Joe = 30000, Frieda = 40000)
seg2tib(V)
#> # A tibble: 3 × 3
#> tmp_seg_names start end
#> <chr> <dbl> <dbl>
#> 1 Amy 0 10000
#> 2 Bob 10000 30000
#> 3 Joe 30000 40000