Learn R Programming

MorphSim (version 0.1.0)

combine.morpho: Combine Two Morpho Objects

Description

This function merges two `morpho` objects, combining their sequences, model parameters, and transition histories, while ensuring tree and fossil consistency.

Usage

combine.morpho(x, y)

Value

A combined `morpho` object.

Arguments

x

A `morpho` object.

y

A `morpho` object.

Examples

Run this code
phy <- ape::rtree(10)

# simulate characters along the branches of the tree
morpho1 <-  sim.morpho(tree = phy,
                           k = c(2,3,4),
                           trait.num = 20,
                           ancestral = TRUE,
                           partition = c(10,5,5),
                           ACRV = "gamma",
                           variable = TRUE,
                           ACRV.ncats = 4,
                           define.Q = NULL)

morpho2 <-  sim.morpho(tree = phy,
                           k = c(2,3,4),
                           trait.num = 20,
                           ancestral = TRUE,
                           partition = c(10,5,5),
                           ACRV = "gamma",
                           variable = TRUE,
                           ACRV.ncats = 4,
                           define.Q = NULL)

combined <- combine.morpho(morpho1, morpho2)

Run the code above in your browser using DataLab