check.morpho | R Documentation |

Performs a fast check of the phylogenetic signal in a morphological matrix using parsimony.

```
check.morpho(
matrix,
orig.tree,
parsimony = "fitch",
first.tree = c(phangorn::dist.hamming, phangorn::NJ),
distance = phangorn::RF.dist,
...,
contrast.matrix,
verbose = FALSE
)
```

`matrix` |
A discrete morphological matrix. |

`orig.tree` |
Optional, the input tree to measure the distance between the parsimony and the original tree. |

`parsimony` |
Either the parsimony algorithm to be passed to |

`first.tree` |
A list of functions to generate the first most parsimonious tree (default = |

`distance` |
Optional, if orig.tree is provided, the function to use for measuring distance between the trees (default = |

`...` |
Any additional arguments to be passed to the parsimony algorithm. |

`contrast.matrix` |
An optional contrast matrix. By default, the function recognises any character state token as different apart from |

`verbose` |
Whether to be verbose or not ( |

The

`first.tree`

argument must be a list of functions to be used in a cascade to transform the matrix (as a`phyDat`

object) into a tree using the functions iteratively. For example the default`c(dist.hamming, NJ)`

will apply the following to the matrix:`NJ(dist.hamming(matrix))`

Returns the parsimony score (using `parsimony`

), the consistency and retention indices (using `CI`

and `RI`

) from the most parsimonious tree obtained from the matrix.
Can also return the topological distance from the original tree if provided.

Thomas Guillerme

`sim.morpho`

, `get.contrast.matrix`

, `optim.parsimony`

```
## Generating a random tree
random_tree <- rcoal(10)
## Generating a random matrix
random_matrix <- sim.morpho(random_tree, characters = 50, model = "ER",
rates = c(rgamma, 1, 1))
## Checking the matrix scores
check.morpho(random_matrix, orig.tree = random_tree)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.