【问题标题】:How to get a PCA plot with PC3 and PC4 with ggbiplot如何使用 ggbiplot 获得 PC3 和 PC4 的 PCA 图
【发布时间】:2021-02-06 19:56:24
【问题描述】:

我需要一些帮助来为我的数据获取 PC3 和 PC4。

**library(ggbiplot)
iris<- read.csv("PCA2_umar.csv")
log.ir <- log(iris[, 1:8])
ir.species <- iris[, 9]

ir.pca <- prcomp(log.ir, center = TRUE, scale. = TRUE)

ggbiplot(ir.pca, obs.scale = 1, var.scale = 1, groups = ir.species, alpha = 0) +
  theme(legend.direction = 'vertical', legend.position = 'right') + 
  scale_color_manual(values=c("Black", "Black")) +
  scale_fill_manual(values = c("#FF8000", "#0080FF")) + # just offset by one to show
  geom_point(size = 3, shape = 21, aes(fill = groups, color = groups))**

附言。另外我怎样才能用不同的符号显示两组。我需要显示一个具有“圆点”符号样式的组。非常感谢Link to Excel data

【问题讨论】:

    标签: r ggplot2 pca


    【解决方案1】:

    通过包含ggbiplot(ir.pca, choices = c(3,4), obs.scale....我们可以得到PC3和PC4。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多