Skip to contents

The extended version of POP format with additional columns for grouping.

Usage

as_pop2(samples)

write_pop2(x, path = "pop2.tsv")

read_pop2(path)

Arguments

samples

A sample_family data.frame of tekka() result.

x

An outcome of as_pop2()

path

A file name or connection to write to.

Value

A data.frame of "pop2" subclass with the following columns:

  • cohort_parent, cohort_offspring: birth year of samples

  • capture_age_parent, capture_age_offspring

  • location_parent, location_offspring: of sampling

  • pops: the count of parent-offspring pairs observed within samples

  • comps: the number of possible comparisons, including only pairs where one sample is younger than the other.

See also

as_pop() for the original POP format.

find_kinship() to count kinship within samples.

Examples

set.seed(666)
result = tekka("-y25 -l2 --sa 2,2 --sj 2,2")
samples = result$sample_family[[1L]]
as_pop2(samples)
#> # A tibble: 42 × 8
#>    cohort_parent cohort_offspring capture_age_parent capture_age_offspring
#>            <int>            <int>              <int>                 <int>
#>  1            14               24                 10                     0
#>  2            18               24                  7                     0
#>  3            18               25                  7                     0
#>  4            14               15                 10                     9
#>  5            14               18                 10                     7
#>  6            14               20                 10                     4
#>  7            14               20                 10                     5
#>  8            14               21                 10                     4
#>  9            14               24                 10                     0
#> 10            14               25                 10                     0
#> # ℹ 32 more rows
#> # ℹ 4 more variables: location_parent <int>, location_offspring <int>,
#> #   pops <int>, comps <int>