Half-sib pairs are counted between samples grouped by birth year and sampled location.
Arguments
- samples
A
sample_familydata.frame oftekka()result.- x
An outcome of
as_hsp()- path
A file name or connection to write to
Value
A data.frame of "hsp" subclass with six columns:
cohort_i,cohort_j: birth year of sampleslocation_i,location_j: of samplingcomps: the number of possible comparisons between group i and j. All samples are compared pairwise, excluding self-comparisons. The total number of comparisons equals \(n \choose 2\), where n is the total sample size.hsps: the count of half-sib pairs observed between group i and j
Details
as_hsp() converts a result data frame to HSP format.
write_hsp() writes a HSP data.frame to a file.
See also
as_hsp2() for the extended HSP 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_hsp(samples)
#> # A tibble: 45 × 6
#> cohort_i cohort_j location_i location_j comps hsps
#> <int> <int> <int> <int> <int> <int>
#> 1 14 15 1 1 1 1
#> 2 20 20 0 0 3 1
#> 3 24 24 1 1 1 1
#> 4 24 25 0 1 4 2
#> 5 25 25 1 1 1 1
#> 6 14 14 1 1 0 0
#> 7 14 18 1 1 2 0
#> 8 14 20 1 0 3 0
#> 9 14 21 1 0 1 0
#> 10 14 24 1 0 2 0
#> # ℹ 35 more rows