Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.9k views
in Technique[技术] by (71.8m points)

r - Is there a way to add centroids and spiders to this PCoA plot code?

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...