New here, and to using R in general. I'm trying to modify a script for generating PCoA plots to include centroids and "spiders" (line segments connecting each sample data point to the centroid). Similar to the attached image.1: https://i.stack.imgur.com/Tjj3T.png
This is the code I've been using:
p.pcoa.wuniRM <- plot_ordination(ps2.prev_RM, ord.pcoa.wuniRM, color = "Location", axes = c(4,5)) +
geom_point(size = 2, aes(shape = Location)) +
labs(title = "PCoA of wUniFrac Distances", color = "Location") +
theme(legend.text = element_text(size=5), aspect.ratio = 1)
Is there an easy way to modify this script to get the centroids and spiders graphed, or do I need to find a different script all together?
question from:
https://stackoverflow.com/questions/65855808/is-there-a-way-to-add-centroids-and-spiders-to-this-pcoa-plot-code 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…