compactify_cladistic_matrix function

Collapses matrix to unique character state distributions

Collapses matrix to unique character state distributions

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

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.

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.

Examples

# 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

See Also

build_cladistic_matrix , prune_cladistic_matrix , read_nexus_matrix , safe_taxonomic_reduction , write_nexus_matrix , write_tnt_matrix

Author(s)

Graeme T. Lloyd graemetlloyd@gmail.com

  • Maintainer: Graeme T. Lloyd
  • License: GPL (>= 2)
  • Last published: 2024-09-03

Useful links