sameGenotype: Find markers for which two individuals have the same genotype

View source: R/marker_stats.R

sameGenotypeR Documentation

Find markers for which two individuals have the same genotype

Description

Identifies markers for which two individuals have the same (non-missing) genotype. The comparison is done after sorting the genotypes internally.

Usage

sameGenotype(x, ids = typedMembers(x), count = FALSE)

Arguments

x

A ped object or a list of such. An error is raised if x has no marker data.

ids

A vector of two individual ID labels.

count

A logical. If TRUE, return the number of markers with shared genotype.

Value

A logical vector with one entry per marker (NA if either genotype is missing). If count = TRUE, the number of TRUE entries.

See Also

isHomozygous(), sortGenotypes()

Examples

x = nuclearPed() |>
  addMarker(name = "m1", geno = c(NA, "1/1", "1/2")) |>
  addMarker(name = "m2", geno = c(NA, "1/2", "2/1"))

sameGenotype(x, 2:3)
sameGenotype(x, 2:3, count = TRUE)


pedtools documentation built on Feb. 1, 2026, 5:06 p.m.