Learn R Programming

DNAprofiles (version 0.3.1)

homozygous: For which markers is the profile homozygous/heterozygous?

Description

For which markers is the profile homozygous/heterozygous?

Usage

homozygous(x, markers = get.markers(x))

Arguments

x
An integer matrix specifying either a single profile or a number of profiles.
markers
Character vector stating the markers to check. Defaults to all markers of x.

Value

logical matrix The value at column m in row i denotes whether profile i is homozygous/heterozygous for marker m.

Examples

Run this code
x <- t(c(1L,1L,1L,2L))
colnames(x) <- c("locus1.1","locus1.2","locus2.1","locus2.2")

homozygous(x,markers = "locus1") # TRUE
homozygous(x,markers = "locus2") # FALSE
homozygous(x) # t(c(TRUE,FALSE))
y <- t(c(1L,NA,1L,2L))
colnames(y) <- c("locus1.1","locus1.2","locus2.1","locus2.2")
homozygous(y,markers = "locus1") # NA
homozygous(y,markers = "locus2") # FALSE
homozygous(y)   # t(c(NA,FALSE))
heterozygous(y) # t(c(NA,TRUE))

Run the code above in your browser using DataLab