char2PathsCategorical: turns a named vector of characters into a paths vector to be...

View source: R/RERfuncs.R

char2PathsCategoricalR Documentation

turns a named vector of characters into a paths vector to be used with getAllCor for categorical traits

Description

turns a named vector of characters into a paths vector to be used with getAllCor for categorical traits

Usage

char2PathsCategorical(
  tipvals,
  treesObj,
  useSpecies = NULL,
  model = "ER",
  plot = FALSE,
  anctrait = NULL,
  root_prior = "auto"
)

Arguments

tipvals

the trait/phenotype/character value at the tip, names(tip.vals) should match some of the mastertree$tip.label, though a perfect match is not required

treesObj

A treesObj created by readTrees

useSpecies

Give only a subset of the species to use for ancestral state reconstruction (e.g., only those species for which the trait can be reliably determined).

model

Specifies what rate model to use

plot

Plots a phenotype tree

anctrait

The trait to use for all ancestral species instead of inferring ancestral states if not NULL. The default is NULL.

root_prior

The prior probabilities of each trait at the root used to fit the transition matrix. Can be a vector of length equal to the number of states or one of the following: "flat", "empirical", "stationary", "likelihoods", "max_likelihood".

Value

A vector of length equal to the number of paths in treesObj


nclark-lab/RERconverge documentation built on March 2, 2024, 8:51 a.m.