Learn R Programming

haplotypes (version 1.1.3.1)

as.list-methods: Methods for function as.list in the Package haplotypes

Description

Coerces an object to a list.

Usage

# S4 method for Dna
as.list(x)
# S4 method for Haplotype
as.list(x)
# S4 method for Parsimnet
as.list(x)

Value

returns a list.

Arguments

x

an object of class Dna,Haplotype or Parsimnet.

Methods

signature(x = "Dna")

coerces an object of class Dna to a list.

signature(x = "Haplotype")

coerces an object of class Haplotype to a list.

signature(x = "Parsimnet")

coerces an object of class Parsimnet to a list.

Details

If x is a Dna object, elements of the list are character vectors that contains the DNA sequences of length equal to corresponding value in the slot seqlengths. If x is Haplotype or Parsimnet objects, slots are converted to list elements.

Examples

Run this code

data("dna.obj")

## Coercing a 'Dna' object to a list.
x<-dna.obj[1:3,as.matrix=FALSE]
as.list(x)

if (FALSE) {
## Coercing a 'Haplotype' object to a list.
x<-dna.obj
h<-haplotype(x)
as.list(h)

## Coercing a 'Parsimnet' object to a list.
x<-dna.obj
p<-parsimnet(x)
as.list(p)
}


Run the code above in your browser using DataLab