to.matrix: Convert a character vector to a binary matrix

View source: R/make.simmap.R View source: R/ancThresh.R

to.matrixR Documentation

Convert a character vector to a binary matrix

Description

Creates a binary matrix, normally from a factor.

Usage

to.matrix(x, seq)

Arguments

x

a vector of characters.

seq

the sequence for the columns in the output matrix.

Details

This function takes a vector of characters or a factor and computes a binary matrix.

Primarily designed to be used internally by make.simmap and rerootingMethod.

Value

A binary matrix of dimensions length(x) by length(seq).

Author(s)

Liam Revell liam.revell@umb.edu

References

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.


liamrevell/phytools documentation built on March 19, 2024, 1:35 p.m.