processAncStates: Process Ancestral States

View source: R/processAncStates.R

processAncStatesR Documentation

Process Ancestral States

Description

Process data for ancestral states plotting

Usage

processAncStates(
  path,
  state_labels = NULL,
  labels_as_numbers = FALSE,
  missing_to_NA = TRUE
)

Arguments

path

(character string; no default) File path to annotated tree.

state_labels

(character vector; NULL) Vector of labels for ancestral states named with the current state labels in annotated tree file (as characters).

labels_as_numbers

(logical; FALSE) Should the state labels be treated as integers (for example, as chromosome numbers)?

missing_to_NA

(logical; TRUE) Should missing data, coded as "?", be coded to NA? If TRUE, the state will not be plotted. If FALSE, it will be considered an additional state when plotting.

Value

A treedata object

Examples


# standard ancestral state estimation example
file <- system.file("extdata",
                    "comp_method_disc/ase_freeK.tree",
                    package="RevGadgets")
example <- processAncStates(file,
                            state_labels = c("1" = "Awesome",
                                             "2" = "Beautiful",
                                             "3" = "Cool!"))

#chromosome evolution example
file <- system.file("extdata",
                    "chromo/ChromEvol_simple_final.tree",
                    package="RevGadgets")
chromo_example <- processAncStates(file, labels_as_numbers = TRUE)


RevGadgets documentation built on May 29, 2024, 10:03 a.m.