Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

to.matrix

Convert a character vector to a binary matrix


Description

This function takes a vector of characters and computes a binary matrix. Primarily to be used internally by make.simmap and rerootingMethod.

Usage

to.matrix(x, seq)

Arguments

x

a vector of characters.

seq

the sequence for the columns in the output matrix.

Value

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

Author(s)

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.


phytools

Phylogenetic Tools for Comparative Biology (and Other Things)

v0.7-70
GPL (>= 2)
Authors
Liam J. Revell
Initial release
2020-9-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.