0

enter image description hereI have a practical visual problem.

I would like to mirror the results of the PCA. In other words, everything that is on the left should go to the right and vice-versa. In my current graph, PCA 1 (see image attached) ranges from more use of inputs (left side) to more ecological management (right side). Visually I just want to mirror the results, so everything that in on the right goes to the left and vice versa. So then, PC1 would range from more ecological management (left side) to more use of inputs (right side). It is basically turning the graph upside down, but I want a function that does that for me! Any thoughts?

I know this issue has already been theoretically covered in other topics. What I need (and can`t find somewhere else) is how to change the visual output in R?

1 Answers1

3

Multiply PC1 by -1 and see if it fits your desired output.

  • 1
    Thank you for your answer! But any idea on how to do that with R? Because right now my code is: #PCA management coffee # ir.pca.management <- prcomp(data_coffee_management[,-c(1,2,3)], center = TRUE, scale. = TRUE) #Visualise#

    mng_PCA_coffee <- ggbiplot(ir.pca.management, obs.scale = 1.5, var.scale = 1, groups=data_coffee_management$farm_type, ellipse = TRUE, circle = FALSE) mng_PCA_coffee <- mng_PCA_coffee + theme(legend.direction = 'horizontal', legend.position = 'top') print(mng_PCA_coffee)

    – Heitor Mancini Teixeira Jul 05 '19 at 10:11