datatoMatrix: Convert a typical data table to probability matrix

View source: R/datatoMatrix.R

datatoMatrixR Documentation

Convert a typical data table to probability matrix

Description

Returns a probability matrix where each column represents a discrete state and each row is a species. Values in the matrix describe the probability of being in any of these states. If a hyper state is specified each species is assumed to be present with equal probability in either hyper state.

Usage

datatoMatrix(x, range = NULL, hyper = T, buffer = 0)

Arguments

x

a dataframe where the first column is the species name, the second column is the number of chromosomes, and the third is the probability in being in state 1 of trait 2

range

a vector of length two with the first element equal to the lowest chromosome number to be included in the model and the second element equal to the highest chromosome number to be included in the model. Defaults to 'NULL', with range determined by the range of chromoesome numbers observed in x

hyper

If 'TRUE' model will include a binary hyper state (col 3 of input data) that can have distinct rates of chromosome number evolution

buffer

Integer value to by which to expand range of chromosome values observed in tips. Only taken into account if range == FALSE, defaults to 0.

Value

a probability matrix is returned

Author(s)

Heath Blackmon


coleoguy/chromePlus documentation built on July 27, 2023, 12:39 p.m.