cluster_to_nexus | R Documentation |
Creates and exports a Nexus file with a list of characters and their respective partitions as inferred by the make_clusters
function. The contents can be copied and pasted directly into a Mr. Bayes commands block for a partitioned clock Bayesian inference analysis.
cluster_to_nexus(cluster_df, file = NULL)
cluster_df |
A |
file |
The path of the text file to be created containing the partitioning information in Nexus format. If |
The text as a string, returned invisibly if file
is not NULL
. Use cat
on the resulting output to format it correctly (i.e., to turn "\n"
into line breaks).
vignette("char-part")
for the use of this function as part of an analysis pipeline.
make_clusters
# See vignette("char-part") for how to use this # function as part of an analysis pipeline # Load example phylogenetic data matrix data("characters") # Create distance matrix Dmatrix <- get_gower_dist(characters) # Find optimal partitioning scheme using PAM under k=3 # partitions cluster_df <- make_clusters(Dmatrix, k = 3) # Write to Nexus file and export to .txt file: file <- tempfile(fileext = ".txt") # You would set, e.g., # file <- "path/to/file.txt" cluster_to_nexus(cluster_df, file = file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.