更改自动绘图 PCA 中显示的方差比例的小数
我想使用 prcomp()
和 autoplot()
更改 PCA 图轴中显示的方差比例
的小数位数>。默认情况下,它设置为 2 位小数(92.46%、5.31%),但我想将它们四舍五入到 1 位小数(92.5%、5.3%)。
库(ggfortify) df <- 虹膜[1:4] pca <- prcomp(df) 自动绘图(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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,使用以下命令禁用显示的默认方差百分比:
然后使用以下命令添加您想要的标签:
First, disable the default variance percentage displayed by using:
Then add the labels you want using: