foreground2Tree: Creates a binary trait tree from a set of foreground species.

View source: R/RERfuncs.R

foreground2TreeR Documentation

Creates a binary trait tree from a set of foreground species.

Description

Creates a binary trait tree from a set of foreground species.

Usage

foreground2Tree(
  foreground,
  treesObj,
  plotTree = T,
  clade = c("ancestral", "terminal", "all"),
  weighted = F,
  transition = "unidirectional",
  useSpecies = NULL
)

Arguments

treesObj

A treesObj created by readTrees

plotTree

Plot a tree representation of the result

clade

A character string indicating which branches within the clade containing the foreground species should be set to foreground. Must be one of the strings "ancestral", "terminal", "all".

weighted

if set to TRUE weights foreground edges belonging to the same clade such that their branch lengths sum up to 1 (only done for clade options "all" and "terminal").

transition

A character string indicating whether transitions between background and foreground branches are "bidirectional" or "unidirectional" (no foreground to background transitions, the default)

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).

foreground.

A character vector containing the foreground species

collapse2anc

Put all the weight on the ancestral branch when the trait appears on a whole clade (redundant to "clade", kept for backwards compatibility)

wholeClade

Whether to implement the weighted edge option across all members of a foreground clade (redundant to "clade", kept for backwards compatibility)

Value

A tree with edge.lengths representing phenotypic states


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