So, I am attempting to create a ggbiplot
of a PCA of prey order in the diet of diurnal and nocturnal raptors, but the problem is that the ggbiplot
function automatically creates arrows for each order. There are only about 8 orders that are significant for my research (i.e., have a value in PC1 and PC2 that is greater than or equal to 0.1).
This is what the ggbiplot
looks like right now:
I've also been able to successfully remove all of the arrows using the var.axes = FALSE
function to get this plot:
But the problem is that from either plot, I'm not sure how to either remove only a portion of the arrows so that I can just keep the 8 that I need, or add those 8 back to the plot from scratch after I remove all of the arrows.
Edit: I want the PC values for all 38 orders to still be factored into the plot, I just want to remove the unnecessary arrows until there are just 8 left.
Reproducible Example:
#load iris data
iris$Species = NULL # (to run the PCA)
iris_pca = prcomp(iris)
ggbiplot(iris_pca) + theme_classic()
So, let's say I don't want to include the arrows for Sepal.Width or Petal.Width. How would I remove those and keep the other two?