PCA plot with PC3 and PC4 using ggbiplot
0
0
Entering edit mode
4.4 years ago
ukhan ▴ 10

I need some help to get PC3 and PC4 for my data.

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

ir.pca <- prcomplog.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))

PS. Also how can I show the two groups with different symbol. I need to show one of the group with "Dot in a circle" symbol style. Many thanks Link to Excel data

R • 686 views
ADD COMMENT
1
Entering edit mode

By including ggbiplot(ir.pca, choices = c(3,4), obs.scale.... we can get PC3 and PC4.

ADD REPLY

Login before adding your answer.

Traffic: 2427 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6