1 year ago

#281339

test-img

elisemillar

Change decimals for proportion of variance displayed in autoplot PCA

I would like to change the number of decimals for the Proportion of Variance displayed in the axes of a PCA plot using prcomp() and autoplot(). By default it's set to 2 decimals places (92.46%, 5.31%) but I'd like to round them to 1 decimal place (92.5%, 5.3%).

library(ggfortify)
df <- iris[1:4]
pca <- prcomp(df)
autoplot(pca)

Thank you!

r

pca

axis-labels

prcomp

autoplot

0 Answers

Your Answer

Accepted video resources