Learn R Programming

EvoPhylo (version 0.3.5)

write_partitioned_alignments: Write character partitions as separate Nexus files (for use in BEAUti)

Description

Write character partitions as separate Nexus files (for use in BEAUti)

Usage

write_partitioned_alignments(x, cluster_df, file)

Value

No return value. This function is called for its side effect of writing alignment files to disk.

Arguments

x

character data matrix as Nexus file (.nex) or data frame (with taxa as rows and characters as columns) read directly from local directory

cluster_df

cluster partitions as outputted by make.clusters

file

path to save the alignments. If file = "example.nex", alignments will be saved to files "example_part1.nex", "example_part2.nex", etc.

See Also

write_partitioned_alignments2 expanded function for exporting both morphological and molecular partitions.

Examples

Run this code
# 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 files
if (FALSE) write_partitioned_alignments(characters, cluster_df, "example.nex")

Run the code above in your browser using DataLab