# 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)
Run the code above in your browser using DataLab