as.list-methods {haplotypes}R Documentation

Methods for function as.list in the Package haplotypes

Description

Coerces an object to a list.

Usage

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

Arguments

x

an object of class Dna,Haplotype or Parsimnet.

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.

Value

returns a list.

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.

Examples


data("dna.obj")

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

## Not run: 
## 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)

## End(Not run)



[Package haplotypes version 1.1.3.1 Index]