output.states.matrix: Outputs results

View source: R/output.results.R

output.states.matrixR Documentation

Outputs results

Description

Outputs ancestral states reconstruction results

Usage

output.states.matrix(
  states_matrix,
  output = NULL,
  file = "Inapp_reconstruction",
  path = ".",
  ...
)

Arguments

states_matrix

A states.matrix list from apply.reconstruction.

output

The type of output, can be either NULL (default) or "newick", "nexus", "csv", "pdf" or "C-test" (see details).

file

The name of the output file(code"character").

path

The path where to save the output file (code"character").

...

If output = "pdf", additional arguments to be passed to plot.states.matrix.

Details

The output contains the for different reconstructions (Dp1, Up1, Dp2, Up2), the potential change or applicable region and the list of tips and nodes Specifically, per data output type: -"newick" outputs a newick string with annotated nodes as follows: (t1[Dp1:X,Up1:X,Dp2:X,Up2:X,Change:X,Applicable:X]). -"nexus" outputs a nexus file with a newick string similar as above but also containing the total tree score, the matrix (one character) and the list of taxa. -"csv" A matrix containing the different state reconstructions and score for each tip and node. -"pdf" A pdf version of the states_matrix plotted with plot.states.matrix. -"C-test" a text version that can be used for testing in C (for DEBUG).

Author(s)

Thomas Guillerme

See Also

apply.reconstruction, plot.states.matrix

Examples

## A random 5 taxa tree
set.seed(1)
tree <- ape::rtree(5, br = NULL)
## A character with inapplicable data
character <- "01-?1"

## NA algorithm
NA_matrix <- apply.reconstruction(tree, character, passes = 4, method = "NA")

## Not run: 
## Exporting the results as an annotated newick tree
output.states.matrix(NA_matrix, output = "newick")

## Exporting the results and notes in a nexus file
output.states.matrix(NA_matrix, output = "nexus")

## Exporting the result in a csv
output.states.matrix(NA_matrix, output = "csv")

## Exporting the plot as a pdf
output.states.matrix(NA_matrix, output = "pdf")

## End(Not run)


TGuillerme/Inapp documentation built on Feb. 4, 2024, 7:26 a.m.