How to draw a circle in PCoA results?

enter image description here

I have results with PC1and PC2for all samples, so I can draw a scatter plot using PC1both x and PC2y.

Now the patterns are labeled with another variable; let them typeindicate which pattern is a register or control. How to draw a graph as above with circles covering the responder type.

In fact, I use the package vegan. I can draw a plot with metaMDSand ordiplot, but I don’t know how to make a circle, as described above. I tried to read the tutorial, but still do not know.

+2
source share
1 answer

ade4.

xy <- cbind.data.frame(x = runif(200, -1, 1), y = runif(200, -1, 1))
posi <- factor(xy$x > 0) : factor(xy$y > 0)
coul <- c("black", "red", "green", "blue")

library(ade4)
pca <- princomp(xy)
s.class(pca$scores[, 1:2], fac = posi, cell = 2, axesell = FALSE, csta = 0, col = coul, clabel = FALSE)

enter image description here

+1

Source: https://habr.com/ru/post/1624909/


All Articles