Learn R Programming

disclapmix2 (version 0.6.1)

unique_haplotype_counts: List unique haplotypes with their counts

Description

List unique haplotypes with their counts

Usage

unique_haplotype_counts(x)

Value

DataFrame with unique rows and a Count column added at the end

Arguments

x

DataFrame (by locus) of character vectors containing haplotypes (rows) where alleles are separated by comma's, e.g. "13,14.2" is a haplotype

Examples

Run this code
# read haplotypes
h <- readxl::read_excel(system.file("extdata","South_Australia.xlsx",
package = "disclapmix2"), 
col_types = "text")[-c(1,2)]

# obtain counts
unique_counts <- disclapmix2::unique_haplotype_counts(h)

# all haplotypes in the dataset are unique
stopifnot(all(unique_counts$Count == 1))

Run the code above in your browser using DataLab