Learn R Programming

Claddis (version 0.7.0)

compactify_cladistic_matrix: Collapses matrix to unique character state distributions

Description

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

Usage

compactify_cladistic_matrix(cladistic_matrix, message = TRUE)

Arguments

cladistic_matrix

The cladistic matrix in the format imported by read_nexus_matrix.

message

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

Author

Graeme T. Lloyd graemetlloyd@gmail.com

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 names into unique character strings.

See Also

build_cladistic_matrix, prune_cladistic_matrix, read_nexus_matrix, safe_taxonomic_reduction, write_nexus_matrix, write_tnt_matrix

Examples

Run this code

# Examine the matrix pre-compactification:
michaux_1989$matrix_1$matrix

# Examine the weights pre-compactification:
michaux_1989$matrix_1$character_weights

# Compactify the matrix:
michaux_1989compact <- compactify_cladistic_matrix(michaux_1989)

# Examine the matrix post-compactification:
michaux_1989compact$matrix_1$matrix

# Examine the weights post-compactification:
michaux_1989compact$matrix_1$character_weights

Run the code above in your browser using DataLab