Parent-offspring pairs are counted between potential offspring cohort and potential parents grouped by age, year, and location of sampling. Comparisons are made only between younger and older samples.
Arguments
- samples
A
sample_family
data.frame oftekka()
result.- x
An outcome of
as_pop()
- path
A file name or connection to write to
Value
A data.frame with "pop" class and six columns:
cohort
: birth year of offspringcapture_year
: of parentscapture_age
: of parentslocation
: where parents were sampledpops
: the count of parent-offspring pairs observed within samplescomps
: the number of possible comparisons.
Details
as_pop()
converts a sample_family
data frame to POP format.
write_pop()
writes a POP data.frame to a file.
See also
as_pop2()
for the extended POP format.
Examples
set.seed(666)
result = tekka("-y20 -l2 --sa 2,2 --sj 2,2")
samples = result$sample_family[[1L]]
as_pop(samples)
#> # A tibble: 30 × 6
#> cohort capture_year capture_age location pops comps
#> <int> <int> <int> <int> <int> <int>
#> 1 19 20 5 1 1 4
#> 2 20 20 9 1 1 4
#> 3 11 19 10 1 0 2
#> 4 14 19 8 1 0 1
#> 5 14 19 10 1 0 1
#> 6 14 20 9 1 0 1
#> 7 15 19 5 0 0 2
#> 8 15 19 8 1 0 2
#> 9 15 19 10 1 0 2
#> 10 15 20 9 1 0 2
#> # ℹ 20 more rows