View source: R/output.results.R
output.states.matrix | R Documentation |
Outputs ancestral states reconstruction results
output.states.matrix(
states_matrix,
output = NULL,
file = "Inapp_reconstruction",
path = ".",
...
)
states_matrix |
A |
output |
The type of output, can be either |
file |
The name of the output file(code"character"). |
path |
The path where to save the output file (code"character"). |
... |
If |
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).
Thomas Guillerme
apply.reconstruction
, plot.states.matrix
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.