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

as.phyDat-methodsR Documentation

Coerces an object to a phyDat object

Description

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

Usage

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

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.

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.

Value

an object of class phyDat.

Methods

signature(x = "Dna")

coerces a Dna object to a phyDat object.

Examples



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



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