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

as.list-methodsR 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)



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