How to make ATP sites as I posted here

I know how to use the PCA results to draw a circle , but failed to draw x.laband y.labbased on the results of plotting from s.class.

How to make a plot as I wrote here? two muppets  I would like to talk more about this.

  • How to make points more or less on another integer variable?

  • Can I ggplot2draw the same circle as s.class? The previous answers do not show how to draw circles.

+4
source share
2 answers

. stat_ellipsis

pca <- prcomp(iris[iris$Species %in% c("virginica","versicolor"),1:4], retx = TRUE,  scale = TRUE,tol=0.4)
predicted <-predict(pca,iris[,1:4])
ggplot(data.frame(predicted))+aes(x=PC1,y=PC2,color=iris$Species)+geom_point(aes(size=iris$Sepal.Length))+stat_ellipse()+stat_ellipse(level=0.8)

enter image description here

+6

pcoa msap s.class :

  • :

    plot(0,0, main=paste(name,surname, sep=": "), type = "n",
      xlab=paste("C1 (",var1,"%)"),ylab=paste("C2 (",var2,"%)"), 
      xlim=c(minX-10^floor(log10(abs(minX))),maxX+10^floor(log10(abs(maxX)))), 
      ylim=c(minY-10^floor(log10(abs(minY))),maxY+10^floor(log10(abs(maxY)))),
     frame=TRUE, cex=1.5)
    

    xlab.

  • / /. cex.

    for(i in 1:ntt){
        points(spcoo[[i]], pch=21, col="black", bg=bgcolors[i])
    }
    
  • , ade4 c.class , , (cpoint = 0)

    s.class(pcol$points, groups, cpoint=0, col=bgcolors, add.plot=TRUE)
    

, PCOA:

enter image description here

+2

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


All Articles