Learn R Programming

phangorn (version 0.0-1)

phyDat: Conversion amoung Sequence Formats

Description

These functions transform several DNA formats into the phyDat format.

Usage

phyDat(data, levels, return.index=FALSE)
phyDat.DNA(data, return.index=FALSE) 
as.phyDat.DNAbin(data, ...)
## S3 method for class 'phyDat':
as.character(x, ...)
## S3 method for class 'phyDat':
as.data.frame(x, ...)

Arguments

data
An object containing sequences.
levels
Level atttributes.
return.index
If TRUE returns a index of the site patterns.
x
An object of class phyDat.
...
further arguments passed to or from other methods.

Value

See Also

as.DNAbin, read.dna and read.nexus.data

Examples

Run this code
data(Laurasiatherian)
class(Laurasiatherian)
Laurasiatherian
# transform into old ape format
LauraChar <- as.character(Laurasiatherian)
# and back 
Laura <- phyDat.DNA(LauraChar, return.index=TRUE)
all.equal(Laurasiatherian, Laura)

Run the code above in your browser using DataLab