Learn R Programming

haplotypes (version 1.1.3.1)

as.DNAbin-methods: Coerces an object to a DNAbin object

Description

This function coerces Dna object to DNAbin {ape} object .

Usage

# S4 method for Dna
as.DNAbin(x, endgaps=TRUE)

Value

an object of class DNAbin.

Arguments

x

an object of class Dna.

endgaps

boolean; gaps at the end of the sequences are included if this is TRUE.

Methods

signature(x = "Dna")

coerces a Dna object to a DNAbin object.

Examples

Run this code

## Coercing a Dna object to a DNAbin object.
data("dna.obj")

x<-dna.obj
dBin<-as.DNAbin(x)
dBin

#gaps at the end removed
dBin<-as.DNAbin(x, endgaps=FALSE)
dBin


Run the code above in your browser using DataLab