How to separate size for variables in ggbiplot PCA

时间:2018-01-23 19:35:31

标签: r plot pca ggbiplot

I'm currently running a PCA (Principal component analysis) on a large dataset with 2000 observation and 21 variables, 20 of these variables are measurements I've done on fossils, and last 1 accounts for species. 7 of the 2000 observations are the fossils I want to increase in size compared to the other when plotting the PCA. What I'm currently running:

log.ir <- log(Size_adjusted_measurements[, 1:20])

ir.species <- Size_adjusted_measurements[, 21] ir.pca <- prcomp(log.ir, center = TRUE, scale. = TRUE)

Now to plot the PCA:

g <- ggbiplot(ir.pca, obs.scale = 1, var.scale = 1, groups = ir.species, labels = FALSE)

g <- g + scale_colour_discrete(name = "Modern") g <- g + theme(legend.direction = 'horizontal', legend.position = 'top') print(g)

I've made a gyazo link with the plot since im not allowed post pictures: https://gyazo.com/b8706a3063243d5d8e19bb3f8b2eb520

Encapsulated by dark circles are the fossils in shape space. How do I modify my plotting code to increase the size of the fossils compared to the rest? I've tried g <- g + scale_size_manual, but this won't kick in. Any help at all is much appreciated.

image

0 个答案:

没有答案