Learn R Programming

phangorn (version 2.12.1)

gap_as_state: Treat gaps as a state

Description

The function gap_as_state changes the contrast of an phyDat object to treat as its own state. Internally phyDat are stored similar to a factor objects and only the contrast matrix and some attributes change.

Usage

gap_as_state(obj, gap = "-", ambiguous = "?")

gap_as_ambiguous(obj, gap = "-")

has_gap_state(obj)

Value

The functions return an object of class phyDat.

Arguments

obj

An object of class phyDat.

gap

a character which codes for the gaps (default is "-").

ambiguous

a character which codes for the ambiguous state

Author

Klaus Schliep klaus.schliep@gmail.com

See Also

phyDat, latag2n.phyDat, latag2n, ancestral.pml, gap_as_state

Examples

Run this code
data(Laurasiatherian)
tmp <- gap_as_state(Laurasiatherian)
contr <- attr(tmp, "contrast")
rownames(contr) <- attr(tmp, "allLevels")
contr

Run the code above in your browser using DataLab