View source: R/Visualizations_Network.R
plot_minium_spanning_tree | R Documentation |
Plots the minimum spanning tree of a given dataset.
plot_minium_spanning_tree(df, labels = NULL)
df |
A data frame with x and y coordinates. |
labels |
A vector of labels for each observation in |
A plot of the minimum spanning tree.
# create sample data
set.seed(123)
x <- rnorm(100)
y <- rnorm(100)
label <- sample(c("A", "B", "C"), 100, replace = TRUE)
df <- data.frame(x = x, y = y, label = label)
# plot the minimum spanning tree
plot_minimum_spanning_tree(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.