R 使用自动绘图的相关和距离双绘图?

R 使用自动绘图的相关和距离双绘图?,r,ggplot2,pca,ggfortify,biplot,R,Ggplot2,Pca,Ggfortify,Biplot,通过R(USArrests)提供的一个例子,我想问是否有人能告诉我自动绘图中的缩放会导致什么?我熟悉Borcard等人(2011)中描述的距离和相关性双标图。autoplot函数使biplot变得更好,但我无法找到如何使用该函数简单地在距离和相关类型biplot之间取消语言 # Distance biplot (scaling = 1) biplot(prcomp(USArrests, scale = TRUE), scale=0) 我可以简单地使用autoplot绘制距离(缩放=

通过R(USArrests)提供的一个例子,我想问是否有人能告诉我自动绘图中的缩放会导致什么?我熟悉Borcard等人(2011)中描述的距离和相关性双标图。autoplot函数使biplot变得更好,但我无法找到如何使用该函数简单地在距离和相关类型biplot之间取消语言

# Distance biplot (scaling = 1)
biplot(prcomp(USArrests, scale = TRUE), scale=0)

我可以简单地使用autoplot绘制距离(缩放=1)吗

是的

ggplot2::autoplot(stats::prcomp(USArrests, scale = TRUE), scale = 0, label = TRUE, loadings.label = TRUE)


给出0@H.F.S C.的类似结果,它回答了你的问题吗?嗨,我想我有一个非常类似的问题,关于autoplot()函数中的缩放是如何工作的。如果不想在prcomp()中设置scale=TRUE,那么在autoplot()中设置缩放是否有意义?换句话说:autoplot()中的“刻度”是否与prcomp()中的“刻度”相同?因为它在我自己的数据上似乎做不到同样的事情。
# using autoplot there are several options: 
library(ggfortify)
ggplot2::autoplot(stats::prcomp(USArrests, scale=TRUE), pc.biplot=TRUE, label = TRUE, loadings.label = TRUE)
# I assume this is equal to the correlation biplot
ggplot2::autoplot(stats::prcomp(USArrests, scale=TRUE), scale=0, label = TRUE, loadings.label = TRUE)
ggplot2::autoplot(stats::prcomp(USArrests, scale=TRUE), scale=1, label = TRUE, loadings.label = TRUE)
ggplot2::autoplot(stats::prcomp(USArrests, scale=TRUE), scale=2, label = TRUE, loadings.label = TRUE)
ggplot2::autoplot(stats::prcomp(USArrests, scale = TRUE), scale = 0, label = TRUE, loadings.label = TRUE)
biplot(prcomp(USArrests, scale = TRUE), scale = s)
lam <- x$sdev[choices]
n <- NROW(scores)
lam <- lam * sqrt(n)
lam <- lam^scale
biplot.default(t(t(scores[, choices])/lam), t(t(x$rotation[, 
        choices]) * lam), ...)