Learn R Programming

haplotypes (version 1.1.3.1)

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

Description

This function coerces Dna object to phyDat {phangorn} object .

Usage

# S4 method for Dna
as.phyDat(x, indels="sic",...)

Value

an object of class phyDat.

Arguments

x

an object of class Dna.

indels

the indel coding method to be used. This must be one of "sic", "5th" or "missing". Any unambiguous substring can be given. See also ‘Details’

...

additional arguments to as.phyDat.

Methods

signature(x = "Dna")

coerces a Dna object to a phyDat object.

Details

Available indel coding methods:

sic:

Treating gaps as a missing character and coding them separately following the simple indel coding method.

5th:

Treating gaps as a fifth state character.

missing:

Treating gaps as a missing character.

Examples

Run this code


data("dna.obj")
x<-dna.obj


## Coercing a Dna object to a phyDat object.
# Simple indel coding.
phyd<-as.phyDat(x)
phyd

# Gaps as 5th state characters.
phyd<-as.phyDat(x,indels="5")
phyd

# Gaps as 5th state characters.
phyd<-as.phyDat(x,indels="m")
phyd


Run the code above in your browser using DataLab