hapreord-methods: Reorders haplotypes according to the ordering factor

hapreord-methodsR Documentation

Reorders haplotypes according to the ordering factor

Description

Reorders haplotypes according to the ordering factor.

Usage

## S4 method for signature 'Haplotype'
hapreord(x,order=c(1:x@nhap))

Arguments

x

an object of class Haplotype.

order

a vector giving the order of haplotypes, with one element per haplotype.

Value

returns an object of class Haplotype.

Methods

signature(x = "Haplotype")

Reorders haplotypes.

Author(s)

Caner Aktas, caktas.aca@gmail.com

See Also

haplotype

Examples

data("dna.obj")
x<-dna.obj[1:6,,as.matrix=FALSE]
# inferring haplotypes from DNA sequences
h<-haplotype(x)

## Reordering haplotypes.

# length of the argument 'order' is equal to the number of haplotypes
rh<-hapreord(h,order=c(4,3,1,2))
rh


haplotypes documentation built on July 26, 2023, 5:22 p.m.