# 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 morphological partitions into multiple Nexus files
if (FALSE) write_partitioned_alignments2(x = "characters.nex",
cluster_df = cluster_df,
out_file = "test", out_type = "standard")
# Write to molecular partitions into multiple Phyllip files
if (FALSE) write_partitioned_alignments2(x = "alignments.phy",
partition_file = "sorted_partitions_50genes.txt",
in_format = "phylip", in_type = "dna",
out_file = "test", out_type = "dna")
Run the code above in your browser using DataLab