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 with "pop" class and six 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

See also

as_pop() for the original POP format.

Examples

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