Learn R Programming

Claddis (version 0.3.4)

CompactifyMatrix: Collapses matrix to unique character state distributions

Description

Collapses a cladistic matrix to just unique character state distributions and taxon names.

Usage

CompactifyMatrix(CladisticMatrix, Message = TRUE)

Arguments

CladisticMatrix

The cladistic matrix in the format imported by ReadMorphNexus.

Message

Logical indicating whether or not a message should be printed to the screen if the matrix cannot be compactified.

Details

Important: not recommended for general use.

This function is intended to make a matrix with redundant character state distributions smaller by collapsing these to single characters and upweighting them accordingly. It is intended purely for use with MRP matrices, but may have some very restricted uses elsewhere.

The function also deletes any characters weighted zero from the matrix and will merge duplicate taxon anmes into unique character strings.

See Also

SafeTaxonomicReduction and MatrixPruner

Examples

Run this code
# NOT RUN {
# Examine the matrix pre-compactification:
Michaux1989$Matrix_1$Matrix

# Examine the weights pre-compactification:
Michaux1989$Matrix_1$Weights

# Compactify the matrix:
Michaux1989compact <- CompactifyMatrix(Michaux1989)

# Examine the matrix post-compactification:
Michaux1989compact$Matrix_1$Matrix

# Examine the weights post-compactification:
Michaux1989compact$Matrix_1$Weights

# }

Run the code above in your browser using DataLab